From e1e5ccbdd80d50b6821c8d219406bb462cda7f0c Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 25 Oct 2008 20:37:05 +1300 Subject: [PATCH] Add support for draft DAV:current-user-principal property. --- inc/caldav-PROPFIND.php | 3 +++ inc/caldav-REPORT.php | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/inc/caldav-PROPFIND.php b/inc/caldav-PROPFIND.php index 03dba56e..3563e858 100644 --- a/inc/caldav-PROPFIND.php +++ b/inc/caldav-PROPFIND.php @@ -249,6 +249,9 @@ function add_general_properties( &$prop, &$not_found, &$denied, $record ) { if ( isset($prop_list['DAV::principal-collection-set']) ) { $prop->NewElement("principal-collection-set", new XMLElement('href', ConstructURL('/') ) ); } + if ( isset($prop_list['DAV::current-user-principal']) ) { + $prop->NewElement("current-user-principal", $request->current_user_principal_xml); + } if ( isset($prop_list['DAV::acl']) ) { /** diff --git a/inc/caldav-REPORT.php b/inc/caldav-REPORT.php index df4d3088..5c091164 100644 --- a/inc/caldav-REPORT.php +++ b/inc/caldav-REPORT.php @@ -122,6 +122,9 @@ function calendar_to_xml( $properties, $item ) { case 'getcontenttype': $prop->NewElement($k, "text/calendar" ); break; +/* +* I don't think this is correct. We should only list these properties against +* the (relevant) collection, not against it's contents. case 'resourcetype': $prop->NewElement($k, new XMLElement($reply->Caldav("calendar"), false) ); if ( $request->collection_type == 'in' ) { @@ -134,6 +137,10 @@ function calendar_to_xml( $properties, $item ) { $prop->NewElement($k, new XMLElement($reply->Caldav("schedule-calendar"), false) ); } break; +*/ + case 'current-user-principal': + $prop->NewElement("current-user-principal", $request->current_user_principal_xml); + break; case 'displayname': $prop->NewElement($k, $displayname ); break;