Handle bound resources correctly in sync-collection report.

This commit is contained in:
Andrew McMillan 2011-12-14 22:18:24 +13:00
parent e641ed0876
commit 71b90d367a
2 changed files with 18 additions and 12 deletions

View File

@ -37,7 +37,10 @@ $collection = new DAVResource( $request->path );
if ( !$collection->Exists() ) {
$request->DoResponse( 404 );
}
$bound_from = $collection->bound_from();
$collection_path = $collection->dav_name();
$request_via_binding = ($bound_from != $collection_path);
$params = array( ':collection_id' => $collection->GetProperty('collection_id'), ':sync_token' => $sync_token );
$sql = "SELECT new_sync_token( :sync_token, :collection_id)";
$qry = new AwlQuery($sql, $params);
@ -101,6 +104,9 @@ EOSQL;
$c->sync_resource_data_ok = false;
}
while( $object = $qry->Fetch() ) {
if ( $request_via_binding )
$object->dav_name = str_replace( $bound_from, $collection_path, $object->dav_name);
if ( $object->dav_name == $last_dav_name ) {
/** The complex case: this is the second or subsequent for this dav_id */
if ( $object->sync_status == 404 ) {

View File

@ -2,14 +2,14 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, calendar-proxy, bind, addressbook, calendar-auto-schedule
ETag: "51330ec2c1868a584176caf2d8b0b195"
Content-Length: 2292
ETag: "7aa94bdf662d6b03f844eaf18239d0a8"
Content-Length: 2301
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>/caldav.php/user2/home/33169d69-2969-4a96-a3e1-2e312b7614e6.ics</href>
<href>/caldav.php/user4/user2/33169d69-2969-4a96-a3e1-2e312b7614e6.ics</href>
<propstat>
<prop>
<getetag>"f2c974ff51cb52cde0668544deb36380"</getetag>
@ -18,7 +18,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/047871e3-6b70-4178-9af8-0ceb50f7b092.ics</href>
<href>/caldav.php/user4/user2/047871e3-6b70-4178-9af8-0ceb50f7b092.ics</href>
<propstat>
<prop>
<getetag>"58cba7e3fafb6080e85619ea77d08c7a"</getetag>
@ -27,7 +27,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/9429a973-2b13-4b1a-be09-948d75425c45.ics</href>
<href>/caldav.php/user4/user2/9429a973-2b13-4b1a-be09-948d75425c45.ics</href>
<propstat>
<prop>
<getetag>"13249ced6c7527191a003f54f7e3cd25"</getetag>
@ -36,7 +36,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/7d729xc0-0895-012d-124e-002421a2359e.ics</href>
<href>/caldav.php/user4/user2/7d729xc0-0895-012d-124e-002421a2359e.ics</href>
<propstat>
<prop>
<getetag>"848df16c32fc3ce319083ae84c2603a3"</getetag>
@ -45,7 +45,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/bd262d20-1cdb-012d-1264-002421a2359e.ics</href>
<href>/caldav.php/user4/user2/bd262d20-1cdb-012d-1264-002421a2359e.ics</href>
<propstat>
<prop>
<getetag>"671d4ee904be6c16dd1be076619fe7c0"</getetag>
@ -54,7 +54,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/56f0e0e0-f742-012d-680c-002421a2359e.ics</href>
<href>/caldav.php/user4/user2/56f0e0e0-f742-012d-680c-002421a2359e.ics</href>
<propstat>
<prop>
<getetag>"e18c0d539b6dcb56df2d266dd4305008"</getetag>
@ -63,7 +63,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/thiswillworkfine.ics</href>
<href>/caldav.php/user4/user2/thiswillworkfine.ics</href>
<propstat>
<prop>
<getetag>"9a8d7696ee2e0a0f1f4170fe4f094a3a"</getetag>
@ -72,7 +72,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/thiswillalsobegood.ics</href>
<href>/caldav.php/user4/user2/thiswillalsobegood.ics</href>
<propstat>
<prop>
<getetag>"1c7895f11787e71fd6dbe3260d72d4a0"</getetag>
@ -81,7 +81,7 @@ Content-Type: text/xml; charset="utf-8"
</propstat>
</response>
<response>
<href>/caldav.php/user2/home/70399cd7-50a4-4be4-a665-af593e19a7fd.ics</href>
<href>/caldav.php/user4/user2/70399cd7-50a4-4be4-a665-af593e19a7fd.ics</href>
<propstat>
<prop>
<getetag>"ea6b316ca24db20f5eb37d1abd60f8c1"</getetag>