mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
add command 'deletefolder'
This commit is contained in:
parent
32d160ed99
commit
b9ace5f6f7
|
@ -256,6 +256,34 @@ switch($command) {
|
|||
}
|
||||
break; /* }}} */
|
||||
|
||||
case 'deletefolder': /* {{{ */
|
||||
if($user) {
|
||||
if(!checkFormKey('removefolder', 'GET')) {
|
||||
header('Content-Type', 'application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>''));
|
||||
} else {
|
||||
$folder = $dms->getFolder($_REQUEST['id']);
|
||||
if($folder) {
|
||||
if ($folder->getAccessMode($user) >= M_READWRITE) {
|
||||
if($folder->remove()) {
|
||||
header('Content-Type', 'application/json');
|
||||
echo json_encode(array('success'=>true, 'message'=>'', 'data'=>''.$_REQUEST['formtoken']));
|
||||
} else {
|
||||
header('Content-Type', 'application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'Error removing folder', 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type', 'application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>''));
|
||||
}
|
||||
} else {
|
||||
header('Content-Type', 'application/json');
|
||||
echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>''));
|
||||
}
|
||||
}
|
||||
}
|
||||
break; /* }}} */
|
||||
|
||||
case 'deletedocument': /* {{{ */
|
||||
if($user) {
|
||||
if(!checkFormKey('removedocument', 'GET')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user