Non-working start on the expand-property report from webdav-versioning.

This commit is contained in:
Andrew McMillan 2009-10-11 15:06:52 -07:00
parent 4c65e6ce9e
commit 64571a284e

View File

@ -0,0 +1,32 @@
<?php
$responses = array();
/**
* Build the array of properties to include in the report output
*/
$props = $xmltree->GetPath('/DAV::expand-property/DAV::property');
$proplist = array();
foreach( $props AS $k => $v ) {
$proplist[] = $v->GetContent();
}
function display_status( $status_code ) {
return sprintf( 'HTTP/1.1 %03d %s', $status_code, getStatusMessage($status_code) );
}
$sql = "SELECT * FROM sync_changes LEFT JOIN calendar_item USING (dav_id) LEFT JOIN caldav_data USING (dav_id) WHERE sync_time > (SELECT modification_time FROM sync_tokens WHERE sync_token = ?)";
$qry = new PgQuery($sql);
if ( $qry->Exec("REPORT",__LINE__,__FILE__) && $qry->rows > 0 ) {
while( $object = $qry->Fetch() ) {
$href = new XMLElement( 'dav_name', ConstructURL($change->href) );
$status = new XMLElement( 'status', display_status($change->status) );
if ( $status != 404 ) {
$propstat = $request->ObjectPropStat($proplist, $object);
}
$responses[] = new XMLElement( 'sync-response', array() );
}
}
$multistatus = new XMLElement( "multistatus", $responses, $reply->GetXmlNsArray() );
$request->XMLResponse( 207, $multistatus );