Check precondition to disallow creating collections in a schedule-inbox.

This commit is contained in:
Andrew McMillan 2010-03-07 20:59:08 +13:00
parent 606e7d6338
commit aeaf09a2d4

View File

@ -12,7 +12,6 @@ dbg_error_log('MKCOL', 'method handler');
require_once('AwlQuery.php');
$request->NeedPrivilege('DAV::bind');
$displayname = $request->path;
// Enforce trailling '/' on collection name
@ -27,6 +26,13 @@ if ( preg_match( '#^(.*/)([^/]+)(/)?$#', $request->path, $matches ) ) {
$displayname = $matches[2];
}
require_once('DAVResource.php');
$parent = new DAVResource( $parent_container );
if ( $parent->IsSchedulingCollection( 'inbox' ) ) {
$request->PreconditionFailed(403, 'urn:ietf:params:xml:ns:caldav:no-mkcol-in-inbox' );
}
$request_type = $request->method;
$is_calendar = ($request_type == 'MKCALENDAR');
$is_addressbook = false;