mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-30 03:24:47 +00:00
Add a configuration option to use the older 'sync-response' tag.
When the WebDAV sync draft first came out the responses were each contained in a DAV::sync-response tag, but by -03 this has changed to a DAV::response tag since the format of the tag contents now match this existing tag structure. Unfortunately some client software in the wild depends on this being a DAV::sync-response so the config option is needed to interoperate with this software.
This commit is contained in:
parent
1e22e9a8a1
commit
b80dd10c7b
@ -46,10 +46,11 @@ $new_token = $row->new_sync_token;
|
|||||||
|
|
||||||
if ( $sync_token == 0 ) {
|
if ( $sync_token == 0 ) {
|
||||||
$sql = <<<EOSQL
|
$sql = <<<EOSQL
|
||||||
SELECT *, 201 AS sync_status FROM collection
|
SELECT collection.*, calendar_item.*, caldav_data.*, addressbook_resource.*, 201 AS sync_status FROM collection
|
||||||
LEFT JOIN caldav_data USING (collection_id)
|
LEFT JOIN caldav_data USING (collection_id)
|
||||||
LEFT JOIN calendar_item USING (dav_id)
|
LEFT JOIN calendar_item USING (dav_id)
|
||||||
WHERE collection.collection_id = :collection_id
|
LEFT JOIN addressbook_resource USING (dav_id)
|
||||||
|
WHERE collection.collection_id = :collection_id
|
||||||
ORDER BY collection.collection_id, caldav_data.dav_id
|
ORDER BY collection.collection_id, caldav_data.dav_id
|
||||||
EOSQL;
|
EOSQL;
|
||||||
unset($params[':sync_token']);
|
unset($params[':sync_token']);
|
||||||
@ -111,7 +112,9 @@ if ( $qry->Exec("REPORT",__LINE__,__FILE__) ) {
|
|||||||
$dav_resource = new DAVResource($object);
|
$dav_resource = new DAVResource($object);
|
||||||
$resultset = array_merge( $resultset, $dav_resource->GetPropStat($proplist,$reply) );
|
$resultset = array_merge( $resultset, $dav_resource->GetPropStat($proplist,$reply) );
|
||||||
}
|
}
|
||||||
$responses[] = new XMLElement( 'response', $resultset );
|
$response_tag = 'response';
|
||||||
|
if ( isset($c->use_old_sync_response_tag) && $c->use_old_sync_response_tag ) $response_tag = 'sync-response';
|
||||||
|
$responses[] = new XMLElement( $response_tag, $resultset );
|
||||||
$first_status = $object->sync_status;
|
$first_status = $object->sync_status;
|
||||||
$last_dav_name = $object->dav_name;
|
$last_dav_name = $object->dav_name;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,33 @@ HTTP/1.1 207 Multi-Status
|
|||||||
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
Date: Dow, 01 Jan 2000 00:00:00 GMT
|
||||||
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
|
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
|
||||||
DAV: extended-mkcol, calendar-proxy, bind, addressbook
|
DAV: extended-mkcol, calendar-proxy, bind, addressbook
|
||||||
ETag: "4f90eca1c5db8d18e5711adc09651e60"
|
ETag: "c02e623cc20b07f8f102bdd60d49ff6a"
|
||||||
Content-Length: 110
|
Content-Length: 747
|
||||||
Content-Type: text/xml; charset="utf-8"
|
Content-Type: text/xml; charset="utf-8"
|
||||||
|
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<multistatus xmlns="DAV:">
|
<multistatus xmlns="DAV:">
|
||||||
|
<response>
|
||||||
|
<href>/caldav.php/user1/addressbook/andrew_mcmillan.vcf</href>
|
||||||
|
<status>HTTP/1.1 201 Created</status>
|
||||||
|
<propstat>
|
||||||
|
<prop>
|
||||||
|
<getetag>"24bae2a7f81c0a79413a656c06d8326b"</getetag>
|
||||||
|
<getcontenttype>text/vcard</getcontenttype>
|
||||||
|
</prop>
|
||||||
|
<status>HTTP/1.1 200 OK</status>
|
||||||
|
</propstat>
|
||||||
|
</response>
|
||||||
|
<response>
|
||||||
|
<href>/caldav.php/user1/addressbook/donald_kelly.vcf</href>
|
||||||
|
<status>HTTP/1.1 201 Created</status>
|
||||||
|
<propstat>
|
||||||
|
<prop>
|
||||||
|
<getetag>"fada70a725708bce8521efb87acfa629"</getetag>
|
||||||
|
<getcontenttype>text/vcard</getcontenttype>
|
||||||
|
</prop>
|
||||||
|
<status>HTTP/1.1 200 OK</status>
|
||||||
|
</propstat>
|
||||||
|
</response>
|
||||||
<sync-token>5</sync-token>
|
<sync-token>5</sync-token>
|
||||||
</multistatus>
|
</multistatus>
|
||||||
|
|||||||
@ -13,6 +13,7 @@ BEGINDATA
|
|||||||
<D:sync-token/>
|
<D:sync-token/>
|
||||||
<D:prop>
|
<D:prop>
|
||||||
<D:getetag/>
|
<D:getetag/>
|
||||||
|
<D:getcontenttype/>
|
||||||
</D:prop>
|
</D:prop>
|
||||||
</D:sync-collection>
|
</D:sync-collection>
|
||||||
ENDDATA
|
ENDDATA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user