From 6f6ad5680731a49d7a1e92b5477bb2684cc8b918 Mon Sep 17 00:00:00 2001 From: raulmateos Date: Thu, 20 Jul 2006 14:17:38 +0000 Subject: [PATCH] (Pandora Console) * snmp_alert.php. Add text when alert not created /updated git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@145 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/CHANGELOG | 2 +- .../operation/snmpconsole/snmp_alert.php | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pandora_console/CHANGELOG b/pandora_console/CHANGELOG index 16668f43d2..8a4dcf3862 100644 --- a/pandora_console/CHANGELOG +++ b/pandora_console/CHANGELOG @@ -1,6 +1,6 @@ 2006-07-20 Raul Mateos - * snmp_alert.php. Add different colors between rows (cosmetic changes). + * snmp_alert.php. Add text when alert not created /updated. Add different colors between rows (cosmetic changes). 2006-07-18 Raul Mateos diff --git a/pandora_console/operation/snmpconsole/snmp_alert.php b/pandora_console/operation/snmpconsole/snmp_alert.php index 2264d843eb..af4de39f0c 100644 --- a/pandora_console/operation/snmpconsole/snmp_alert.php +++ b/pandora_console/operation/snmpconsole/snmp_alert.php @@ -71,11 +71,21 @@ if (give_acl($id_user, 0, "LW")==1) { if ($create == 1){ $sql = "INSERT INTO talert_snmp (id_alert,al_field1,al_field2,al_field3,description,alert_type,agent,custom_oid,oid,time_threshold,max_alerts,min_alerts) VALUES ($alert_id,'$field1','$field2','$field3','$description', $alert_type, '$agent', '$custom', '$oid', $time, $max, $min)"; + $result=mysql_query($sql); + if (!$result) + echo "

".$lang_label["create_alert_no"]."

"; + else + echo "

".$lang_label["create_alert_ok"]."

"; } else { $sql = "UPDATE talert_snmp set id_alert= $alert_id, al_field1 = '$field1', al_field2 = '$field2', al_field3 = '$field3', description = '$description', alert_type = $alert_type, agent = '$agent', custom_oid = '$custom', oid = '$oid', time_threshold = $time, max_alerts = '$max', min_alerts = '$min' WHERE id_as = $id_as"; + $result=mysql_query($sql); + if (!$result) + echo "

".$lang_label["update_alert_no"]."

"; + else + echo "

".$lang_label["create_alert_ok"]."

"; } - $result=mysql_query($sql); + } // Alert update: (first, load data used in form), later use insert/add form // ============ @@ -179,13 +189,11 @@ if (give_acl($id_user, 0, "LW")==1) { echo ""; echo ""; } - // Endtable echo ""; $view_alert =0; // Do not show alert list } - if ($view_alert == 1) { // View alerts defined on SNMP traps $sql1='SELECT * FROM talert_snmp'; @@ -194,9 +202,6 @@ if (give_acl($id_user, 0, "LW")==1) { echo '

'.$lang_label["snmp_assigned_alerts"]." ".$lang_label["help"]."

"; if (mysql_num_rows($result)){ - if ($alert_submit !=0) { - echo '

'.$lang_label["create_alert_ok"].'

'; - } echo ''; echo '
'.$lang_label["alert"]; echo ''.$lang_label["alert_type"];