mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-25 02:34:17 +00:00
Add support for principal-search-property-set REPORT per RFC3744
This commit is contained in:
parent
45e1222a9d
commit
6269980fd5
@ -641,6 +641,7 @@ EOQRY;
|
||||
|
||||
$this->supported_reports = array(
|
||||
'DAV::principal-property-search' => '',
|
||||
'DAV::principal-search-property-set' => '',
|
||||
'DAV::expand-property' => '',
|
||||
'DAV::sync-collection' => ''
|
||||
);
|
||||
|
||||
36
inc/caldav-REPORT-pps-set.php
Normal file
36
inc/caldav-REPORT-pps-set.php
Normal 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 );
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user