diff --git a/inc/caldav-MKCOL.php b/inc/caldav-MKCOL.php index 7b001893..edc38084 100644 --- a/inc/caldav-MKCOL.php +++ b/inc/caldav-MKCOL.php @@ -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;