Permalink
Browse files

Fix for CalDAV servers placed on relative paths

  • Loading branch information...
adobo committed Oct 8, 2012
1 parent 63480dd commit d8cf945a44a0abe1181b4c8c465e30e977c9a3d8
@@ -306,7 +306,13 @@ Here you will configure every single aspect of your CalDAV server.
.. confval:: caldav_base_url
- Base CalDAV URL used to build all CalDAV URLs
+ Base CalDAV URL used to build all CalDAV URLs. If your CalDAV server is located under a relative path don't specify
+ it here. Do not add trailing slash.
+
+ Examples::
+
+ // This will work for CalDAV servers placed on root URL or under any relative path
+ $config['caldav_base_url'] = 'http://my.caldav.server';
.. versionadded:: 1.3.0
@@ -342,52 +348,64 @@ Here you will configure every single aspect of your CalDAV server.
This is just a path, not a full URL. Your :confval:`caldav_base_url` will be prepended to this value.
+ Remember to add the relative path to your CalDAV server if it's not located under your root URL.
+
Needs a trailing slash.
Example::
// Example 1: DAViCal
$config['caldav_principal_template'] = '/caldav.php/%u/';
- // Example 2: SabreDAV
+ // Example 2: DAViCal on http://my.caldav.server/davical/...
+ $config['caldav_principal_template'] = '/davical/caldav.php/%u/';
+
+ // Example 3: SabreDAV
$config['caldav_principal_template'] = '/calendarserver.php/principals/%u/';
- // Example 3: Calendar server
+ // Example 4: Calendar server
$config['caldav_principal_template'] = '/calendars/users/%u/';
.. versionadded:: 1.3.0
- .. seealso:: :confval:`caldav_calendar_homeset_template`
+ .. seealso:: :confval:`caldav_base_url` and :confval:`caldav_calendar_homeset_template`
.. confval:: caldav_calendar_homeset_template
Used by AgenDAV to search for calendars for current user. ``%u`` will be replaced with a username.
This is just a path, not a full URL. Your :confval:`caldav_base_url` will be prepended to this value.
+ Remember to add the relative path to your CalDAV server if it's not located under your root URL.
+
Example::
// DAViCal
$config['caldav_calendar_homeset_template'] = '/caldav.php/%u/';
+
+ // DAViCal under /davical
+ $config['caldav_calendar_homeset_template'] = '/davical/caldav.php/%u/';
.. versionadded:: 1.3.0
- .. seealso:: :confval:`caldav_base_url`
+ .. seealso:: :confval:`caldav_base_url` and :confval:`caldav_principal_template`
.. confval:: caldav_public_base_url
The base URL that will be shown to users if :confval:`show_public_caldav_url` is
enabled. It's not used for internal connections.
+ If your CalDAV server is located under a relative path don't specify it here. Do not add trailing slash.
+
Do not add a trailing slash.
Example::
$config['public_caldav_url'] = 'https://public.caldav.tld';
- Will become for user ``user2`` and calendar ``myhomecalendar``:
+ For a DAViCal server placed on /davical will become for user ``user2`` and calendar ``myhomecalendar``:
- https://public.caldav.tld/caldav.php/user2/myhomecalendar/
+ https://public.caldav.tld/davical/caldav.php/user2/myhomecalendar/
.. confval:: enable_calendar_sharing
@@ -40,6 +40,8 @@ $config['caldav_http_auth_method'] = null;
* This URL will be used to build the rest of URLs (principals and
* calendars)
*
+ * If your CalDAV server is placed under a relative path, don't specify it here
+ *
* Please, do NOT add trailing slash
*/
@@ -51,10 +53,13 @@ $config['caldav_base_url'] = 'http://caldav.server';
*
* Do not use a full URL, use a relative path to be appended to your caldav_base_url
*
+ * Remember to add your CalDAV server relative path if needed
+ *
* %u will be replaced by an username. Please, add trailing slash
*
* Some examples:
* - DAViCal: /caldav.php/%u/
+ * - DAViCal under non-root path: /davical/caldav.php/%u/
* - SabreDAV: /calendarserver.php/principals/%u/
* - Apple Calendar Server: /users/%u/
*/
@@ -67,11 +72,14 @@ $config['caldav_principal_template'] = '/caldav.php/%u/';
*
* Do not use a full URL, use a relative path to be appended to your caldav_base_url
*
+ * Remember to add your CalDAV server relative path if needed
+ *
* %u will be replaced by an username. Please, add trailing slash
*
* Some samples:
*
* - DAViCal: /caldav.php/%u/
+ * - DAViCal under non-root path: /davical/caldav.php/%u/
* - SabreDAV: /calendarserver.php/calendars/%u/
* - Apple Calendar Server: /calendars/users/%u/
*/
@@ -83,6 +91,7 @@ $config['caldav_calendar_homeset_template'] = '/caldav.php/%u/';
* ====================================
*
* Please, do NOT add trailing slash.
+ * If your CalDAV server is placed under a relative path, don't specify it here
* Will be shown to users only when 'show_public_caldav_url' is enabled
*/
@@ -81,15 +81,15 @@ public function __construct($app_user, IURLGenerator $urlgenerator, $logger, $op
}
/**
- * Checks current user authentication against provided
+ * Checks current user authentication against current user principal URL
*
* @param string $url
* @access public
* @return boolean
*/
- public function checkAuthentication($url = '/')
+ public function checkAuthentication()
{
- return $this->CheckValidCalDAV($url);
+ return $this->CheckValidCalDAV($this->PrincipalURL());
}
/**
@@ -28,13 +28,12 @@
interface ICalDAVClient
{
/**
- * Checks current user authentication against provided
+ * Checks current user authentication against current user principal URL
*
- * @param string $url
* @access public
* @return boolean
*/
- public function checkAuthentication($url = '/');
+ public function checkAuthentication();
/**
* Checks if provided resource is accesible for current user

0 comments on commit d8cf945

Please sign in to comment.