diff --git a/inc/caldav-PROPPATCH.php b/inc/caldav-PROPPATCH.php index 43b9e655..dc5b48cc 100644 --- a/inc/caldav-PROPPATCH.php +++ b/inc/caldav-PROPPATCH.php @@ -100,7 +100,11 @@ foreach( $setprops AS $k => $setting ) { */ case 'DAV::GETETAG': case 'DAV::GETCONTENTLENGTH': + case 'DAV::GETCONTENTTYPE': + case 'DAV::GETLASTMODIFIED': case 'DAV::CREATIONDATE': + case 'DAV::LOCKDISCOVERY': + case 'DAV::SUPPORTEDLOCK': $failure['set-'.$tag] = new XMLElement( 'propstat', array( new XMLElement( 'prop', new XMLElement($tag)), new XMLElement( 'status', 'HTTP/1.1 409 Conflict' ), @@ -154,8 +158,12 @@ foreach( $rmprops AS $k => $setting ) { */ case 'DAV::GETETAG': case 'DAV::GETCONTENTLENGTH': + case 'DAV::GETCONTENTTYPE': + case 'DAV::GETLASTMODIFIED': case 'DAV::CREATIONDATE': case 'DAV::DISPLAYNAME': + case 'DAV::LOCKDISCOVERY': + case 'DAV::SUPPORTEDLOCK': $failure['rm-'.$tag] = new XMLElement( 'propstat', array( new XMLElement( 'prop', new XMLElement($tag)), new XMLElement( 'status', 'HTTP/1.1 409 Conflict' ), @@ -175,7 +183,9 @@ foreach( $rmprops AS $k => $setting ) { } - +/** +* If we have encountered any instances of failure, the whole damn thing fails. +*/ if ( count($failure) > 0 ) { foreach( $success AS $tag => $v ) { // Unfortunately although these succeeded, we failed overall, so they didn't happen... @@ -193,7 +203,9 @@ if ( count($failure) > 0 ) { } - +/** +* Otherwise we will try and do the SQL. This is inside a transaction, so PostgreSQL guarantees the atomicity +*/ $sql .= "COMMIT;"; $qry = new PgQuery( $sql ); if ( $qry->Exec() ) { @@ -204,6 +216,11 @@ if ( $qry->Exec() ) { $request->DoResponse( 200, $multistatus->Render(0,''), 'text/xml; charset="utf-8"' ); } +/** +* Or it was all crap. +*/ +$request->DoResponse( 500 ); + exit(0); ?> \ No newline at end of file