Limit scope of collections_always_exist to user's own folders.

This commit is contained in:
Andrew McMillan 2008-11-26 14:38:18 +13:00
parent ae4bb2eed8
commit a1aa782c17
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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);