From e6e1f0c071e1c0c8d7840f42c63a86a656a19552 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 31 Jan 2011 09:23:05 +0000 Subject: [PATCH] 2011-01-31 Miguel de Dios * include/javascript/pandora_modules.js, pandoradb.sql, extras/pandoradb_migrate_v3.2_to_v4.0.sql, godmode/modules/manage_network_components_form.php, godmode/modules/manage_network_components_form_network.php, godmode/modules/manage_network_components.php: added the "post process" parameter to network component and use in network component editor and module editor. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3788 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++++++ .../extras/pandoradb_migrate_v3.2_to_v4.0.sql | 5 +++++ .../godmode/modules/manage_network_components.php | 7 +++++-- .../godmode/modules/manage_network_components_form.php | 2 ++ .../modules/manage_network_components_form_network.php | 6 ++++++ pandora_console/include/javascript/pandora_modules.js | 1 + pandora_console/pandoradb.sql | 1 + 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 24d9f879dc..97e208163b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2011-01-31 Miguel de Dios + + * include/javascript/pandora_modules.js, pandoradb.sql, + extras/pandoradb_migrate_v3.2_to_v4.0.sql, + godmode/modules/manage_network_components_form.php, + godmode/modules/manage_network_components_form_network.php, + godmode/modules/manage_network_components.php: added the "post process" + parameter to network component and use in network component editor and + module editor. + 2011-01-27 Sancho Lerena * ssh_console/howto_sign_applet.README, diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql index 2476ce3808..e7a9fda852 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql @@ -22,3 +22,8 @@ -- Table `tgrupo` -- ----------------------------------------------------- ALTER TABLE `tgrupo` MODIFY `nombre` text; + +-- ----------------------------------------------------- +-- Table `tnetwork_component` +-- ----------------------------------------------------- +ALTER TABLE `tnetwork_component` ADD COLUMN `post_process` double(18,13) default 0; diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index fc03e8f194..30b59730c7 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -55,6 +55,7 @@ $min_critical = (int) get_parameter ('min_critical'); $max_critical = (int) get_parameter ('max_critical'); $ff_event = (int) get_parameter ('ff_event'); $history_data = (bool) get_parameter ('history_data'); +$post_process = (float) get_parameter('post_process'); $id = (int) get_parameter ('id'); $snmp_version = (string) get_parameter('snmp_version'); @@ -128,7 +129,8 @@ if ($create_component) { 'min_ff_event' => $ff_event, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, - 'custom_string_3' => $custom_string_3)); + 'custom_string_3' => $custom_string_3, + 'post_process' => $post_process)); if ($id === false) { print_error_message (__('Could not be created')); include_once ('godmode/modules/manage_network_components_form.php'); @@ -183,7 +185,8 @@ if ($update_component) { 'min_ff_event' => $ff_event, 'custom_string_1' => $custom_string_1, 'custom_string_2' => $custom_string_2, - 'custom_string_3' => $custom_string_3)); + 'custom_string_3' => $custom_string_3, + 'post_process' => $post_process)); if ($result === false) { print_error_message (__('Could not be updated')); include_once ('godmode/modules/manage_network_components_form.php'); diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 560d160cb6..c42f89091c 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -54,6 +54,7 @@ if (isset ($id)) { $min_critical = $component["min_critical"]; $ff_event = $component["min_ff_event"]; $history_data = $component["history_data"]; + $post_process = $component["post_process"]; if ($type >= 15 && $type <= 18) { @@ -90,6 +91,7 @@ if (isset ($id)) { $min_critical = 0; $ff_event = 0; $history_data = true; + $post_process = 0; $snmp_version = 1; $snmp3_auth_user = ''; diff --git a/pandora_console/godmode/modules/manage_network_components_form_network.php b/pandora_console/godmode/modules/manage_network_components_form_network.php index 8fdeaea3c3..7a32123664 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_network.php +++ b/pandora_console/godmode/modules/manage_network_components_form_network.php @@ -78,6 +78,12 @@ $data[3] = print_select(array('noAuthNoPriv' => __('Not auth and not privacy met 'authNoPriv' => __('Auth and not privacy method'), 'authPriv' => __('Auth and privacy method')), 'snmp3_security_level', $snmp3_security_level, '', '', '', true); push_table_row($data, 'field_snmpv3_row3'); +$data = array(); +$data[0] = __('Post process').' '.print_help_icon ('postprocess', true); +$data[1] = print_input_text ('post_process', $post_process, '', 12, 25, true); +$data[2] = $data[3] = ''; +push_table_row($data, 'field_process'); + /* Advanced stuff */ diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index a6f308b7d5..27a43027da 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -153,6 +153,7 @@ function configure_modules_form () { $("#text-min_critical").attr ("value", (data["min_critical"] == 0) ? 0 : data["min_critical"]); $("#text-max_critical").attr ("value", (data["max_critical"] == 0) ? 0 : data["max_critical"]); $("#text-ff_threshold").attr ("value", (data["min_ff_event"] == 0) ? 0 : data["min_ff_event"]); + $("#text-post_process").attr("value", (data["post_process"] == 0) ? 0 : data["post_process"]) $("#component_loading").hide (); $("#id_module_type").change (); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index f0ae6303d6..8ec19aa25e 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -526,6 +526,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `custom_string_3` text default '', `custom_integer_1` int(10) default 0, `custom_integer_2` int(10) default 0, + `post_process` double(18,13) default 0, PRIMARY KEY (`id_nc`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;