mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #3667 from laf/issue-3526
Un-acknowledging an alert will allow it to continue sending alerts
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user