Add support for principal-search-property-set REPORT per RFC3744

This commit is contained in:
Andrew McMillan 2009-12-27 23:29:57 +13:00
parent 45e1222a9d
commit 6269980fd5
3 changed files with 40 additions and 0 deletions

View File

@ -641,6 +641,7 @@ EOQRY;
$this->supported_reports = array(
'DAV::principal-property-search' => '',
'DAV::principal-search-property-set' => '',
'DAV::expand-property' => '',
'DAV::sync-collection' => ''
);

View File

@ -0,0 +1,36 @@
<?php
/**
* DAViCal CalDAV Server - handle principal-search-property-set report (RFC3744)
*
* @package davical
* @subpackage caldav
* @author Andrew McMillan <andrew@mcmillan.net.nz>
* @copyright Morphoss Ltd - http://www.morphoss.com/
* @license http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
*/
/**
* Wrap an individual property name as needed
*/
function property_response( &$xmldoc, $property ) {
$prop = new XMLElement( 'prop' );
$xmldoc->NSElement($prop, $property );
return new XMLElement( 'principal-search-property', $prop );
}
$principal_search_property_set = array(
'DAV::displayname',
'http://calendarserver.org/ns/:email-address-set',
'urn:ietf:params:xml:ns:caldav:calendar-home-set'
);
$responses = array();
foreach( $principal_search_property_set AS $k => $tag ) {
$responses[] = property_response( $reply, $tag );
}
$report = new XMLElement( 'principal-search-property-set', $responses, $reply->GetXmlNsArray() );
$request->XMLResponse( 207, $report );

View File

@ -52,6 +52,9 @@ switch( $xmltree->GetTag() ) {
case 'DAV::principal-property-search':
include("caldav-REPORT-principal.php");
exit; // Not that it should return anyway.
case 'DAV::principal-search-property-set':
include("caldav-REPORT-pps-set.php");
exit; // Not that it should return anyway.
case 'DAV::sync-collection':
include("caldav-REPORT-sync-collection.php");
exit; // Not that it should return anyway.