mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-28 18:16:05 +00:00
Check XML is present, and also do need-privileges response.
This commit is contained in:
parent
dc72ddf3a8
commit
da6e9a07e2
@ -3,11 +3,23 @@
|
||||
* We support both LOCK and UNLOCK methods in this function
|
||||
*/
|
||||
|
||||
require_once('XMLDocument.php');
|
||||
$reply = new XMLDocument(array( 'DAV:' => '' ));
|
||||
|
||||
if ( ! $request->AllowedTo('write') ) {
|
||||
$request->DoResponse( 403, translate("You do not have sufficient access to lock that") );
|
||||
$request->NeedPrivilege( 'write', $request->path );
|
||||
}
|
||||
|
||||
if ( ! isset($request->xml_tags) ) {
|
||||
if ( isset($request->lock_token) ) {
|
||||
// It's OK for LOCK refresh requests to be empty.
|
||||
$request->xml_tags = array();
|
||||
}
|
||||
else {
|
||||
$request->XMLResponse( 400, new XMLElement( 'error', new XMLElement('missing-xml-for-request'), $reply->GetXmlNsArray() ) );
|
||||
}
|
||||
}
|
||||
|
||||
require_once("XMLElement.php");
|
||||
|
||||
$unsupported = array();
|
||||
$lockinfo = array();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user