mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now. Fixed all errors, left most warnings.
This commit is contained in:
@@ -20,8 +20,7 @@ if (is_admin() === false) {
|
||||
if (!is_numeric($_POST['template_id'])) {
|
||||
echo 'ERROR: No template selected';
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$rules = preg_split('/,/', mres($_POST['rule_id']));
|
||||
$success = false;
|
||||
foreach ($rules as $rule_id) {
|
||||
@@ -29,15 +28,14 @@ else {
|
||||
if ($db_id > 0) {
|
||||
$success = true;
|
||||
$ids[] = $db_id;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo 'ERROR: Alert rules have not been attached to this template.';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($success === true) {
|
||||
dbDelete('alert_template_map', 'id NOT IN ('.implode(',', $ids).') AND alert_templates_id =?',array($_POST['template_id']));
|
||||
dbDelete('alert_template_map', 'id NOT IN ('.implode(',', $ids).') AND alert_templates_id =?', array($_POST['template_id']));
|
||||
echo "Alert rules have been attached to this template. $template_map_ids";
|
||||
exit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user