2008-10-16 Sancho Lerena <slerena@gmail.com>

* 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
This commit is contained in:
slerena 2008-10-16 18:06:31 +00:00
parent bbc320c6c7
commit 50c97b1de0
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2008-10-16 Sancho Lerena <slerena@gmail.com>
* operation/snmpconsole/snmp_alert.php: Fixed problem creating
alerts, missing process_sql(). Default values now shown properly.
2008-10-16 Ramon Novoa <rnovoa@artica.es> 2008-10-16 Ramon Novoa <rnovoa@artica.es>
* godmode/modules/manage_network_components_form_wmi.php: Added * godmode/modules/manage_network_components_form_wmi.php: Added

View File

@ -56,7 +56,7 @@ if (isset ($_GET["submit"])) {
$al_field2 = (string) get_parameter_post ("al_field2"); $al_field2 = (string) get_parameter_post ("al_field2");
$al_field3 = (string) get_parameter_post ("al_field3"); $al_field3 = (string) get_parameter_post ("al_field3");
$max_alerts = (int) get_parameter_post ("max_alerts", 1); $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); $priority = (int) get_parameter_post ("priority", 0);
if ($time_threshold == -1) { if ($time_threshold == -1) {
@ -67,10 +67,10 @@ if (isset ($_GET["submit"])) {
$sql = sprintf ("INSERT INTO talert_snmp $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) (id_alert, al_field1, al_field2, al_field3, description, alert_type, agent, custom_oid, oid, time_threshold, max_alerts, min_alerts, priority)
VALUES 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); $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) { if ($result === false) {
echo '<h3 class="error">'.__('There was a problem creating the alert').'</h3>'; echo '<h3 class="error">'.__('There was a problem creating the alert').'</h3>';
@ -97,7 +97,7 @@ if (isset ($_GET["submit"])) {
// From variable init // 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); $id_as = (int) get_parameter_get ("update_alert", -1);
$alert = get_db_row ("talert_snmp", "id_as", $id_as); $alert = get_db_row ("talert_snmp", "id_as", $id_as);
$id_as = $alert["id_as"]; $id_as = $alert["id_as"];
@ -128,7 +128,7 @@ if (isset ($_GET["update_alert"]) && $_GET["update_alert"]) {
$al_field2 = ""; $al_field2 = "";
$al_field3 = ""; $al_field3 = "";
$max_alerts = 1; $max_alerts = 1;
$min_alerts = 1; $min_alerts = 0;
$priority = 0; $priority = 0;
} }