Fix deleting snapshots
This commit is contained in:
parent
1f1678064e
commit
f236e25e22
|
@ -8,8 +8,10 @@ $data = array();
|
|||
// INITIALIZE AND CHECK SANITY
|
||||
//
|
||||
|
||||
if ( !canView('Snapshots') ) $message = 'Insufficient permissions for user '.$user['Username'];
|
||||
if (!canView('Snapshots'))
|
||||
$message = 'Insufficient permissions for user '.$user['Username'];
|
||||
|
||||
$task = '';
|
||||
if (empty($_REQUEST['task'])) {
|
||||
$message = 'Must specify a task';
|
||||
} else {
|
||||
|
@ -17,9 +19,9 @@ if ( empty($_REQUEST['task']) ) {
|
|||
}
|
||||
|
||||
if (empty($_REQUEST['ids'])) {
|
||||
if ( isset($_REQUEST['task']) && $_REQUEST['task'] != 'query' ) $message = 'No snapshot id(s) supplied';
|
||||
if ($task != 'query') $message = 'No snapshot id(s) supplied';
|
||||
} else {
|
||||
$eids = $_REQUEST['ids'];
|
||||
$ids = $_REQUEST['ids'];
|
||||
}
|
||||
|
||||
if ($message) {
|
||||
|
@ -99,6 +101,7 @@ function deleteRequest($id) {
|
|||
//$message[] = array($id=>'Event is archived, cannot delete it.');
|
||||
} else {
|
||||
$snapshot->delete();
|
||||
$message[] = array($id=>'Snapshot deleted.');
|
||||
}
|
||||
|
||||
return $message;
|
||||
|
|
Loading…
Reference in New Issue