Fix deleting snapshots
This commit is contained in:
parent
ad9ce720fd
commit
2f7c44dce2
|
@ -8,8 +8,10 @@ $data = array();
|
||||||
// INITIALIZE AND CHECK SANITY
|
// 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'])) {
|
if (empty($_REQUEST['task'])) {
|
||||||
$message = 'Must specify a task';
|
$message = 'Must specify a task';
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,9 +19,9 @@ if ( empty($_REQUEST['task']) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_REQUEST['ids'])) {
|
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 {
|
} else {
|
||||||
$eids = $_REQUEST['ids'];
|
$ids = $_REQUEST['ids'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($message) {
|
if ($message) {
|
||||||
|
@ -99,6 +101,7 @@ function deleteRequest($id) {
|
||||||
//$message[] = array($id=>'Event is archived, cannot delete it.');
|
//$message[] = array($id=>'Event is archived, cannot delete it.');
|
||||||
} else {
|
} else {
|
||||||
$snapshot->delete();
|
$snapshot->delete();
|
||||||
|
$message[] = array($id=>'Snapshot deleted.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
|
|
Loading…
Reference in New Issue