mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
do not allow to delete non empty folders
only admins may delete folders
This commit is contained in:
parent
945e39eb1a
commit
f2ca92f48b
|
@ -608,10 +608,19 @@ class HTTP_WebDAV_Server_LetoDMS extends HTTP_WebDAV_Server
|
|||
}
|
||||
|
||||
if (get_class($obj) == 'LetoDMS_Core_Folder') {
|
||||
if($obj->hasDocuments() || $obj->hasSubFolders()) {
|
||||
return "409 Conflict";
|
||||
}
|
||||
if(!$obj->remove()) {
|
||||
return "409 Conflict";
|
||||
}
|
||||
} else {
|
||||
// check if user is admin
|
||||
// only admins may delete documents
|
||||
if(!$this->user->isAdmin()) {
|
||||
return "403 Forbidden";
|
||||
}
|
||||
|
||||
if(!$obj->remove()) {
|
||||
return "409 Conflict";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user