The <allprop> can be at the top level, not within the <prop>.

This commit is contained in:
Andrew McMillan 2010-02-26 13:45:30 +13:00
parent 7a3adb6764
commit 429940f4d9
5 changed files with 72 additions and 6 deletions

View File

@ -305,11 +305,10 @@ CREATE INDEX sync_processing_index ON sync_changes( collection_id, dav_id, sync_
CREATE TABLE access_ticket (
ticket_id TEXT PRIMARY KEY,
is_collection BOOLEAN,
is_public BOOLEAN,
privileges BIT(24),
target_id INT8,
displayname TEXT,
expires TIMESTAMP,
expires TIMESTAMP
);
SELECT new_db_revision(1,2,8, 'Août' );

View File

@ -13,7 +13,7 @@ CREATE TABLE access_ticket (
privileges BIT(24),
target_id INT8,
displayname TEXT,
expires TIMESTAMP,
expires TIMESTAMP
);
SELECT new_db_revision(1,2,8, 'Août' );

View File

@ -29,10 +29,22 @@ $xmltree = BuildXMLTree( $request->xml_tags, $position);
if ( !is_object($xmltree) ) {
$request->DoResponse( 403, translate("REPORT body is not valid XML data!") );
}
$properties = $xmltree->GetPath('/DAV::propfind/DAV::prop/*');
$allprop = $xmltree->GetPath('/DAV::propfind/*');
$property_list = array();
foreach( $properties AS $k => $v ) {
$property_list[] = $v->GetTag();
foreach( $allprop AS $k1 => $propwrap ) {
switch ( $propwrap->GetTag() ) {
case 'DAV::allprop':
$property_list[] = 'DAV::allprop';
break;
case 'DAV::propname':
$property_list[] = 'DAV::propname';
break;
default: // prop, include
$subprop = $propwrap->GetElements();
foreach( $subprop AS $k => $v ) {
$property_list[] = $v->GetTag();
}
}
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<response>
<href>/caldav.php/user1/home/</href>
<propstat>
<prop>
<getcontenttype>httpd/unix-directory</getcontenttype>
<resourcetype>
<collection/>
<C:calendar/>
</resourcetype>
<displayname>user1 home</displayname>
<getlastmodified>Dow, 01 Jan 2000 00:00:00 GMT</getlastmodified>
<creationdate>YYYY-MM-DDThh:mm:ss+ZZ:ZZ</creationdate>
<getcontentlanguage/>
<supportedlock>
<lockentry>
<lockscope>
<exclusive/>
</lockscope>
<locktype>
<write/>
</locktype>
</lockentry>
</supportedlock>
<owner>
<href>/caldav.php/user1/</href>
</owner>
<current-user-principal>
<href>/caldav.php/user1/</href>
</current-user-principal>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>

View File

@ -0,0 +1,19 @@
#
# Testing for Spec compliance. PROPFIND on a calendar collection.
#
TYPE=PROPFIND
URL=http://mycaldav/caldav.php/user1/home/
HEADER=User-Agent: RFC2518 Spec Tests
HEADER=Depth: 0
HEADER=Content-Type: application/xml
REPLACE=#<creationdate>2\d{3}-\d\d-\d\dT\d\d:\d\d:\d\d[+-]\d\d:\d\d</creationdate>#<creationdate>YYYY-MM-DDThh:mm:ss+ZZ:ZZ</creationdate>#
BEGINDATA
<?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:">
<allprop/>
</propfind>
ENDDATA
# REPLACE=/<get.tag>"[0-9a-f]{32}"<.get.tag>/<get?tag>"deadbeefcafef00ddeadbeefcafefeed"<.get?tag>/