From 1711fb68aa6bb977905fc3af83cf1e143518383e Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Fri, 26 Feb 2010 13:29:11 +1300 Subject: [PATCH] Modification of protected properties should be a 403. We might as well send an error response along with that, too. --- inc/caldav-PROPPATCH.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/caldav-PROPPATCH.php b/inc/caldav-PROPPATCH.php index 6de065bb..43321b6a 100644 --- a/inc/caldav-PROPPATCH.php +++ b/inc/caldav-PROPPATCH.php @@ -70,7 +70,8 @@ foreach( $setprops AS $k => $setting ) { else { $failure['set-'.$tag] = new XMLElement( 'propstat', array( new XMLElement( 'prop', new XMLElement($tag)), - new XMLElement( 'status', 'HTTP/1.1 409 Conflict' ), + new XMLElement( 'status', 'HTTP/1.1 403 Forbidden' ), + new XMLElement( 'error', new XMLElement( 'cannot-modify-protected-property') ), new XMLElement( 'responsedescription', translate("The displayname may only be set on collections or principals.") ) )); } @@ -91,7 +92,8 @@ foreach( $setprops AS $k => $setting ) { else { $failure['set-'.$tag] = new XMLElement( 'propstat', array( new XMLElement( 'prop', new XMLElement($tag)), - new XMLElement( 'status', 'HTTP/1.1 409 Conflict' ), + new XMLElement( 'status', 'HTTP/1.1 403 Forbidden' ), + new XMLElement( 'error', new XMLElement( 'cannot-modify-protected-property') ), new XMLElement( 'responsedescription', translate("Resources may not be changed to / from collections.") ) )); } @@ -134,7 +136,8 @@ foreach( $setprops AS $k => $setting ) { case 'DAV::supportedlock': $failure['set-'.$tag] = new XMLElement( 'propstat', array( new XMLElement( 'prop', new XMLElement($tag)), - new XMLElement( 'status', 'HTTP/1.1 409 Conflict' ), + new XMLElement( 'status', 'HTTP/1.1 403 Forbidden' ), + new XMLElement( 'error', new XMLElement( 'cannot-modify-protected-property') ), new XMLElement('responsedescription', translate("Property is read-only") ) )); break;