mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-23 06:39:18 +00:00
Check for existence of target resource before we check for READ perm.
This commit is contained in:
parent
766e825f99
commit
adb1f949ac
@ -19,12 +19,12 @@ require_once('DAVResource.php');
|
|||||||
$reply = new XMLDocument( array( 'DAV:' => '' ) );
|
$reply = new XMLDocument( array( 'DAV:' => '' ) );
|
||||||
|
|
||||||
if ( !isset($request->xml_tags) ) {
|
if ( !isset($request->xml_tags) ) {
|
||||||
$request->DoResponse( 403, translate("REPORT body contains no XML data!") );
|
$request->DoResponse( 403, translate("Request body contains no XML data!") );
|
||||||
}
|
}
|
||||||
$position = 0;
|
$position = 0;
|
||||||
$xmltree = BuildXMLTree( $request->xml_tags, $position);
|
$xmltree = BuildXMLTree( $request->xml_tags, $position);
|
||||||
if ( !is_object($xmltree) ) {
|
if ( !is_object($xmltree) ) {
|
||||||
$request->DoResponse( 403, translate("REPORT body is not valid XML data!") );
|
$request->DoResponse( 403, translate("Request body is not valid XML data!") );
|
||||||
}
|
}
|
||||||
$allprop = $xmltree->GetPath('/DAV::propfind/*');
|
$allprop = $xmltree->GetPath('/DAV::propfind/*');
|
||||||
$property_list = array();
|
$property_list = array();
|
||||||
@ -217,10 +217,10 @@ if ( $request->IsProxyRequest() ) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$resource = new DAVResource($request->path);
|
$resource = new DAVResource($request->path);
|
||||||
$resource->NeedPrivilege('DAV::read');
|
|
||||||
if ( ! $resource->Exists() ) {
|
if ( ! $resource->Exists() ) {
|
||||||
$request->DoResponse( 404, translate('That resource is not present on this server.') );
|
$request->DoResponse( 404, translate('That resource is not present on this server.') );
|
||||||
}
|
}
|
||||||
|
$resource->NeedPrivilege('DAV::read');
|
||||||
if ( $resource->IsCollection() ) {
|
if ( $resource->IsCollection() ) {
|
||||||
dbg_error_log('PROPFIND','Getting collection contents: Depth %d, Path: %s', $request->depth, $resource->dav_name() );
|
dbg_error_log('PROPFIND','Getting collection contents: Depth %d, Path: %s', $request->depth, $resource->dav_name() );
|
||||||
$responses[] = $resource->RenderAsXML($property_list, $reply);
|
$responses[] = $resource->RenderAsXML($property_list, $reply);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user