diff --git a/inc/caldav-OPTIONS.php b/inc/caldav-OPTIONS.php index c18e260a..d0b153b0 100644 --- a/inc/caldav-OPTIONS.php +++ b/inc/caldav-OPTIONS.php @@ -33,7 +33,7 @@ else { $is_calendar = ($collection->is_calendar == 't'); $exists = true; } - elseif ( $c->collections_always_exist ) { + elseif ( $c->collections_always_exist && preg_match( "#^/$session->username/#", $request->path) ) { $exists = true; // Possibly this should be another setting, but it seems unlikely that something that // can't deal with collections would issue MKCALENDAR or PROPPATCH commands. diff --git a/inc/caldav-PROPFIND.php b/inc/caldav-PROPFIND.php index e315dacb..0211e568 100644 --- a/inc/caldav-PROPFIND.php +++ b/inc/caldav-PROPFIND.php @@ -573,7 +573,7 @@ function get_collection_contents( $depth, $user_no, $collection ) { * subsidiary collections will also be got up to $depth */ function get_collection( $depth, $user_no, $collection_path ) { - global $c, $request; + global $session, $c, $request; $responses = array(); dbg_error_log("PROPFIND","Getting collection: Depth %d, User: %d, Path: %s", $depth, $user_no, $collection_path ); @@ -606,7 +606,7 @@ function get_collection( $depth, $user_no, $collection_path ) { if( $qry->Exec("PROPFIND",__LINE__,__FILE__) && $qry->rows > 0 && $collection = $qry->Fetch() ) { $responses[] = collection_to_xml( $collection ); } - elseif ( $c->collections_always_exist ) { + elseif ( $c->collections_always_exist && preg_match( "#^/$session->username/#", $collection_path) ) { dbg_error_log("PROPFIND","Using $c->collections_always_exist setting is deprecated" ); $collection->dav_name = $collection_path; $collection->dav_etag = md5($collection_path);