From 50c97b1de0fd93f824d05cf8b3e0210a544bed0f Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 16 Oct 2008 18:06:31 +0000 Subject: [PATCH] 2008-10-16 Sancho Lerena * operation/snmpconsole/snmp_alert.php: Fixed problem creating alerts, missing process_sql(). Default values now shown properly. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1160 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/operation/snmpconsole/snmp_alert.php | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 87007249c5..e2dae169d2 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2008-10-16 Sancho Lerena + + * operation/snmpconsole/snmp_alert.php: Fixed problem creating + alerts, missing process_sql(). Default values now shown properly. + 2008-10-16 Ramon Novoa * godmode/modules/manage_network_components_form_wmi.php: Added diff --git a/pandora_console/operation/snmpconsole/snmp_alert.php b/pandora_console/operation/snmpconsole/snmp_alert.php index 929eb65ce9..5cf469cd93 100644 --- a/pandora_console/operation/snmpconsole/snmp_alert.php +++ b/pandora_console/operation/snmpconsole/snmp_alert.php @@ -56,7 +56,7 @@ if (isset ($_GET["submit"])) { $al_field2 = (string) get_parameter_post ("al_field2"); $al_field3 = (string) get_parameter_post ("al_field3"); $max_alerts = (int) get_parameter_post ("max_alerts", 1); - $min_alerts = (int) get_parameter_post ("min_alerts", 1); + $min_alerts = (int) get_parameter_post ("min_alerts", 0); $priority = (int) get_parameter_post ("priority", 0); if ($time_threshold == -1) { @@ -67,10 +67,10 @@ if (isset ($_GET["submit"])) { $sql = sprintf ("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, priority) VALUES - (%d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, %d, %d, %d)", + (%d, '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, %d, %d, %d) ", $alert_type, $al_field1, $al_field2, $al_field3, $description, $alert_trigger, $source_ip, $custom_value, $oid, $time_threshold, $max_alerts, $min_alerts, $priority); - //$result = process_sql ($sql); + $result = process_sql ($sql); if ($result === false) { echo '

'.__('There was a problem creating the alert').'

'; @@ -97,7 +97,7 @@ if (isset ($_GET["submit"])) { // From variable init // ================== -if (isset ($_GET["update_alert"]) && $_GET["update_alert"]) { +if ((isset ($_GET["update_alert"])) && ($_GET["update_alert"] != -1)) { $id_as = (int) get_parameter_get ("update_alert", -1); $alert = get_db_row ("talert_snmp", "id_as", $id_as); $id_as = $alert["id_as"]; @@ -128,7 +128,7 @@ if (isset ($_GET["update_alert"]) && $_GET["update_alert"]) { $al_field2 = ""; $al_field3 = ""; $max_alerts = 1; - $min_alerts = 1; + $min_alerts = 0; $priority = 0; }