mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Scrutinizer issues fixed
This commit is contained in:
@@ -499,6 +499,8 @@ function list_alert_rules() {
|
|||||||
global $config;
|
global $config;
|
||||||
$app = \Slim\Slim::getInstance();
|
$app = \Slim\Slim::getInstance();
|
||||||
$router = $app->router()->getCurrentRoute()->getParams();
|
$router = $app->router()->getCurrentRoute()->getParams();
|
||||||
|
$sql = '';
|
||||||
|
$param = array();
|
||||||
if(isset($router['id']) && $router['id'] > 0) {
|
if(isset($router['id']) && $router['id'] > 0) {
|
||||||
$rule_id = mres($router['id']);
|
$rule_id = mres($router['id']);
|
||||||
$sql = "WHERE id=?";
|
$sql = "WHERE id=?";
|
||||||
@@ -521,6 +523,7 @@ function list_alerts() {
|
|||||||
} else {
|
} else {
|
||||||
$param = array('1');
|
$param = array('1');
|
||||||
}
|
}
|
||||||
|
$sql = '';
|
||||||
if(isset($router['id']) && $router['id'] > 0) {
|
if(isset($router['id']) && $router['id'] > 0) {
|
||||||
$alert_id = mres($router['id']);
|
$alert_id = mres($router['id']);
|
||||||
$sql = "AND id=?";
|
$sql = "AND id=?";
|
||||||
@@ -607,6 +610,7 @@ function delete_rule() {
|
|||||||
$rule_id = mres($router['id']);
|
$rule_id = mres($router['id']);
|
||||||
$status = 'error';
|
$status = 'error';
|
||||||
$err_msg = '';
|
$err_msg = '';
|
||||||
|
$message = '';
|
||||||
$code = 500;
|
$code = 500;
|
||||||
if(is_numeric($rule_id)) {
|
if(is_numeric($rule_id)) {
|
||||||
$status = 'ok';
|
$status = 'ok';
|
||||||
@@ -632,6 +636,7 @@ function ack_alert() {
|
|||||||
$alert_id = mres($router['id']);
|
$alert_id = mres($router['id']);
|
||||||
$status = 'error';
|
$status = 'error';
|
||||||
$err_msg = '';
|
$err_msg = '';
|
||||||
|
$message = '';
|
||||||
$code = 500;
|
$code = 500;
|
||||||
if(is_numeric($alert_id)) {
|
if(is_numeric($alert_id)) {
|
||||||
$status = 'ok';
|
$status = 'ok';
|
||||||
|
|||||||
Reference in New Issue
Block a user