summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/dav.inc.php.sample3
-rw-r--r--lib/Kolab/CalDAV/Calendar.php13
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php1
-rw-r--r--lib/Kolab/DAV/Auth/HTTPBasic.php15
-rw-r--r--lib/Kolab/DAVACL/PrincipalBackend.php4
-rw-r--r--public_html/.htaccess4
-rw-r--r--public_html/index.php4
7 files changed, 26 insertions, 18 deletions
diff --git a/config/dav.inc.php.sample b/config/dav.inc.php.sample
index be7b0dd..59cb765 100644
--- a/config/dav.inc.php.sample
+++ b/config/dav.inc.php.sample
@@ -25,6 +25,9 @@
$rcmail_config = array();
// Log DAV requests to <log_dir>/davdebug
+$rcmail_config['base_uri'] = null;
+
+// Log DAV requests to <log_dir>/davdebug
$rcmail_config['kolab_dav_debug'] = false;
// User agent string written to kolab storage MIME messages
diff --git a/lib/Kolab/CalDAV/Calendar.php b/lib/Kolab/CalDAV/Calendar.php
index 7b33744..40a6b35 100644
--- a/lib/Kolab/CalDAV/Calendar.php
+++ b/lib/Kolab/CalDAV/Calendar.php
@@ -59,19 +59,6 @@ class Calendar extends \Sabre\CalDAV\Calendar
/**
- * Getter for a nice and human readable name for this calendar
- * See http://wiki.kolab.org/UI-Concepts/Folder-Listing for reference
- *
- * @return string Name of this calendar
- */
- public function getName()
- {
- $folder = kolab_storage::object_name($this->imap_folder, $this->namespace);
- return $folder;
- }
-
-
- /**
* Returns the owner principal
*
* This must be a url to a principal, or null if there's no owner
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php
index 3dd5016..a277353 100644
--- a/lib/Kolab/CalDAV/CalendarBackend.php
+++ b/lib/Kolab/CalDAV/CalendarBackend.php
@@ -279,7 +279,6 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
$storage = $this->get_storage_folder($calendarId);
if ($storage && ($event = $storage->get_object($uid))) {
- console('FOUND: ' . $event['uid']);
return array(
'id' => $event['uid'],
'uri' => $event['uid'] . '.ics',
diff --git a/lib/Kolab/DAV/Auth/HTTPBasic.php b/lib/Kolab/DAV/Auth/HTTPBasic.php
index 23a7ac0..036d54f 100644
--- a/lib/Kolab/DAV/Auth/HTTPBasic.php
+++ b/lib/Kolab/DAV/Auth/HTTPBasic.php
@@ -34,7 +34,7 @@ use Kolab\Utils\CacheAPC;
class HTTPBasic extends \Sabre\DAV\Auth\Backend\AbstractBasic
{
// Make the current user name availabel to all classes
- public static $current_user;
+ public static $current_user = null;
/**
* Validates a username and password
@@ -97,4 +97,17 @@ class HTTPBasic extends \Sabre\DAV\Auth\Backend\AbstractBasic
return $success;
}
+
+ /**
+ * Returns information about the currently logged in username.
+ *
+ * If nobody is currently logged in, this method should return null.
+ *
+ * @return string|null
+ */
+ public function getCurrentUser()
+ {
+ // return the canonic user name
+ return self::$current_user;
+ }
}
diff --git a/lib/Kolab/DAVACL/PrincipalBackend.php b/lib/Kolab/DAVACL/PrincipalBackend.php
index 4f46eca..7297747 100644
--- a/lib/Kolab/DAVACL/PrincipalBackend.php
+++ b/lib/Kolab/DAVACL/PrincipalBackend.php
@@ -63,7 +63,7 @@ class PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\BackendInterfac
if (HTTPBasic::$current_user) {
return array(
- 'uri' => '/' . HTTPBasic::$current_user,
+ 'uri' => 'principals/' . HTTPBasic::$current_user,
'{DAV:}displayname' => HTTPBasic::$current_user,
);
}
@@ -116,6 +116,8 @@ class PrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\BackendInterfac
*/
public function getPrincipalByPath($path)
{
+ console(__METHOD__, $path);
+
list($prefix,$name) = explode('/', $path);
if ($prefix == 'principals' && $name == HTTPBasic::$current_user) {
diff --git a/public_html/.htaccess b/public_html/.htaccess
index f2eca1a..c63d795 100644
--- a/public_html/.htaccess
+++ b/public_html/.htaccess
@@ -1,5 +1,9 @@
RewriteEngine On
+RewriteBase /
+RewriteRule ^\.well-known/caldav / [R,L]
+RewriteRule ^\.well-known/carddav / [R,L]
+
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [qsappend,last]
diff --git a/public_html/index.php b/public_html/index.php
index 1049f99..25c53bb 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -84,7 +84,7 @@ if ($debug = $rcube->config->get('kolab_dav_debug')) {
// Make sure this setting is turned on and reflects the root url of the *DAV server.
-$base_uri = slashify(substr(dirname($_SERVER['SCRIPT_FILENAME']), strlen($_SERVER['DOCUMENT_ROOT'])));
+$base_uri = $rcube->config->get('base_uri', slashify(substr(dirname($_SERVER['SCRIPT_FILENAME']), strlen($_SERVER['DOCUMENT_ROOT']))));
// create the various backend instances
@@ -111,7 +111,7 @@ $server->setBaseUri($base_uri);
// register some plugins
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($auth_backend, 'KolabDAV'));
-//$server->addPlugin(new \Sabre\DAVACL\Plugin()); // we'll add that later
+$server->addPlugin(new \Sabre\DAVACL\Plugin()); // we'll add that later
$server->addPlugin(new \Kolab\CalDAV\Plugin());
//$server->addPlugin(new \Sabre\CardDAV\Plugin());
$server->addPlugin(new \Sabre\DAV\Browser\Plugin());