mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +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 (get_class($obj) == 'LetoDMS_Core_Folder') {
|
||||||
|
if($obj->hasDocuments() || $obj->hasSubFolders()) {
|
||||||
|
return "409 Conflict";
|
||||||
|
}
|
||||||
if(!$obj->remove()) {
|
if(!$obj->remove()) {
|
||||||
return "409 Conflict";
|
return "409 Conflict";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// check if user is admin
|
||||||
|
// only admins may delete documents
|
||||||
|
if(!$this->user->isAdmin()) {
|
||||||
|
return "403 Forbidden";
|
||||||
|
}
|
||||||
|
|
||||||
if(!$obj->remove()) {
|
if(!$obj->remove()) {
|
||||||
return "409 Conflict";
|
return "409 Conflict";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user