diff --git a/inc/caldav-REPORT.php b/inc/caldav-REPORT.php index f742e2d2..4c68a4e2 100644 --- a/inc/caldav-REPORT.php +++ b/inc/caldav-REPORT.php @@ -23,10 +23,6 @@ if ( ! ini_get('open_basedir') && (isset($c->dbg['ALL']) || (isset($c->dbg['repo } } -$target = new DAVResource($request->path); - -$target->NeedPrivilege( array('DAV::read', 'urn:ietf:params:xml:ns:caldav:read-free-busy') ); - if ( !isset($request->xml_tags) ) { $request->DoResponse( 406, translate("REPORT body contains no XML data!") ); } @@ -36,6 +32,13 @@ if ( !is_object($xmltree) ) { $request->DoResponse( 406, translate("REPORT body is not valid XML data!") ); } +$target = new DAVResource($request->path); + +if ( $xmltree->GetTag() != 'DAV::principal-property-search' + && $xmltree->GetTag() != 'DAV::principal-property-search-set' ) { + $target->NeedPrivilege( array('DAV::read', 'urn:ietf:params:xml:ns:caldav:read-free-busy'), true ); // They may have either +} + require_once("iCalendar.php"); $reportnum = -1; @@ -44,7 +47,7 @@ $denied = array(); $unsupported = array(); if ( isset($prop_filter) ) unset($prop_filter); -if ( $xmltree->GetTag() == "urn:ietf:params:xml:ns:caldav:free-busy-query" ) { +if ( $xmltree->GetTag() == 'urn:ietf:params:xml:ns:caldav:free-busy-query' ) { include("caldav-REPORT-freebusy.php"); exit; // Not that the above include should return anyway }