diff --git a/htdocs/caldav.php b/htdocs/caldav.php index a8a1a73b..f81eebf2 100644 --- a/htdocs/caldav.php +++ b/htdocs/caldav.php @@ -22,9 +22,13 @@ $session = new HTTPAuthSession(); * access-control is rfc3744, so we will say we do it, but I doubt if we do it * in all (or even much of) it's glory really. */ -$dav = "1, 2, access-control, calendar-access"; +if ( isset($c->override_dav_header) ) { + $dav = $c->override_dav_header; +} +else { + $dav = "1, 2, access-control, calendar-access"; +} header( "DAV: $dav"); -// header( "DAV: 1, 2, access-control, calendar-access, calendar-schedule"); require_once("CalDAVRequest.php"); $request = new CalDAVRequest(); diff --git a/inc/caldav-PROPFIND.php b/inc/caldav-PROPFIND.php index 72e4b808..50aac4f4 100644 --- a/inc/caldav-PROPFIND.php +++ b/inc/caldav-PROPFIND.php @@ -117,6 +117,12 @@ function namespace_array() { } +function calendar_server_tag( $tag ) { + add_namespace("A", "http://calendarserver.org/ns/"); + return ns_tag( $tag, 'http://calendarserver.org/ns/' ); +} + + function caldav_tag( $tag ) { return ns_tag( $tag, 'urn:ietf:params:xml:ns:caldav' ); } @@ -158,6 +164,7 @@ foreach( $request->xml_tags AS $k => $v ) { case 'GETCONTENTLENGTH': /** getcontentlength- should work fine */ case 'GETCONTENTTYPE': /** getcontenttype - should work fine */ case 'GETETAG': /** getetag - should work fine */ + case 'GETCTAG': /** Calendar Server extension like etag - should work fine (we just return etag) */ case 'SUPPORTEDLOCK': /** supportedlock - should work fine */ case 'PRINCIPAL-URL': /** principal-url - should work fine */ case 'RESOURCETYPE': /** resourcetype - should work fine */ @@ -291,12 +298,10 @@ function add_principal_properties( &$prop, &$not_found, &$denied ) { } if ( isset($attribute_list['DROPBOX-HOME-URL'] ) ) { - add_namespace("A", "http://calendarserver.org/ns/"); - $prop->NewElement("A:dropbox-home-url", new XMLElement('href', $request->principal->dropbox_url) ); + $prop->NewElement(calendar_server_tag("dropbox-home-url"), new XMLElement('href', $request->principal->dropbox_url) ); } if ( isset($attribute_list['NOTIFICATIONS-URL'] ) ) { - add_namespace("A", "http://calendarserver.org/ns/"); - $prop->NewElement("A:notifications-url", new XMLElement('href', $request->principal->notifications_url) ); + $prop->NewElement(calendar_server_tag("notifications-url"), new XMLElement('href', $request->principal->notifications_url) ); } if ( isset($attribute_list['CALENDAR-USER-ADDRESS-SET'] ) ) { @@ -379,6 +384,10 @@ function collection_to_xml( $collection ) { if ( isset($attribute_list['ALLPROP']) || isset($attribute_list['GETETAG']) ) { $prop->NewElement("getetag", '"'.$collection->dav_etag.'"' ); } + if ( isset($attribute_list['GETCTAG']) ) { + // Calendar Server extension which only applies to collections. We return the etag, which does the needful. + $prop->NewElement(calendar_server_tag('getctag'),$collection->dav_etag ); + } if ( isset($attribute_list['ALLPROP']) || isset($attribute_list['CURRENT-USER-PRIVILEGE-SET']) ) { $prop->NewElement("current-user-privilege-set", privileges($request->permissions) ); } diff --git a/inc/caldav-REPORT-multiget.php b/inc/caldav-REPORT-multiget.php index 516fda59..44ca771c 100644 --- a/inc/caldav-REPORT-multiget.php +++ b/inc/caldav-REPORT-multiget.php @@ -1,5 +1,9 @@ - + /caldav.php/user1/home/ @@ -16,13 +16,13 @@ Content-Type: text/xml; charset="utf-8" home + faf25336de0e470a54075c14cbcf5272 HTTP/1.1 200 OK - - + HTTP/1.1 404 Not Found