Merge pull request #3667 from laf/issue-3526

Un-acknowledging an alert will allow it to continue sending alerts
This commit is contained in:
Daniel Preussker
2016-06-16 05:30:22 +00:00
committed by GitHub

View File

@@ -19,19 +19,21 @@ if (!is_numeric($alert_id)) {
echo 'ERROR: No alert selected';
exit;
}
else if (!is_numeric($state)) {
elseif (!is_numeric($state)) {
echo 'ERROR: No state passed';
exit;
}
else {
if ($state == 2) {
$state = dbFetchCell('SELECT alerted FROM alerts WHERE id = ?', array($alert_id));
$open = 1;
}
else if ($state >= 1) {
elseif ($state >= 1) {
$state = 2;
$open = 1;
}
if (dbUpdate(array('state' => $state), 'alerts', 'id=?', array($alert_id)) >= 0) {
if (dbUpdate(array('state' => $state, 'open' => $open), 'alerts', 'id=?', array($alert_id)) >= 0) {
echo 'Alert acknowledged status changed.';
exit;
}