Use URL construction in PROPPATCH handling.

This commit is contained in:
Andrew McMillan 2007-11-25 13:03:41 +13:00
parent c0c8d2d19f
commit 96e579910b
3 changed files with 8 additions and 6 deletions

View File

@ -195,7 +195,8 @@ if ( count($failure) > 0 ) {
));
}
array_unshift( $failure, new XMLElement('href', $c->protocol_server_port_script . $request->path ) );
$url = $request->ConstructURL($request->path);
array_unshift( $failure, new XMLElement('href', $url ) );
$failure[] = new XMLElement('responsedescription', translate("Some properties were not able to be changed.") );
$multistatus = new XMLElement( "multistatus", new XMLElement( 'response', $failure ), array('xmlns'=>'DAV:') );
@ -209,7 +210,8 @@ if ( count($failure) > 0 ) {
$sql .= "COMMIT;";
$qry = new PgQuery( $sql );
if ( $qry->Exec() ) {
$href = new XMLElement('href', $c->protocol_server_port_script . $request->path );
$url = $request->ConstructURL($request->path);
$href = new XMLElement('href', $url );
$desc = new XMLElement('responsedescription', translate("All requested changes were made.") );
$multistatus = new XMLElement( "multistatus", new XMLElement( 'response', array( $href, $desc ) ), array('xmlns'=>'DAV:') );

View File

@ -1,13 +1,13 @@
HTTP/1.1 200 OK
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access
Content-Length: 239
Content-Length: 224
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>http://mycaldav/caldav.php/user1/home/</href>
<href>/caldav.php/user1/home/</href>
<responsedescription>All requested changes were made.</responsedescription>
</response>
</multistatus>

View File

@ -1,13 +1,13 @@
HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, access-control, calendar-access
Content-Length: 464
Content-Length: 449
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:">
<response>
<href>http://mycaldav/caldav.php/user1/home/</href>
<href>/caldav.php/user1/home/</href>
<propstat>
<prop>
<DAV::RESOURCETYPE/>