From 042adc3014305ed8fa395a395c919543d0a6c3fb Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Fri, 28 Oct 2011 13:00:25 +0000 Subject: [PATCH] 2011-10-28 Juan Manuel Ramon * godmode/modules/manage_network_components_form.php godmode/modules/manage_network_components_form_network.php godmode/modules/manage_network_components.php: Fixed network components creation and interface problems. Fixes: #3421589 * include/help/en/help_projection_graph.php include/help/en/help_prediction_date.php include/help/es/help_projection_graph.php include/help/es/help_prediction_date.php images/help/prediction_date.png images/help/projection_periods.png godmode/reporting/reporting_builder.item_editor.php: Added contextual help. Forgot to update Changelog. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5099 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 18 +++ .../modules/manage_network_components.php | 6 +- .../manage_network_components_form.php | 112 +++++++++++++++++- ...manage_network_components_form_network.php | 3 +- 4 files changed, 133 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ee25c40130..cea96af128 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,21 @@ +2011-10-28 Juan Manuel Ramon + + * godmode/modules/manage_network_components_form.php + godmode/modules/manage_network_components_form_network.php + godmode/modules/manage_network_components.php: Fixed network + components creation and interface problems. + + Fixes: #3421589 + + * include/help/en/help_projection_graph.php + include/help/en/help_prediction_date.php + include/help/es/help_projection_graph.php + include/help/es/help_prediction_date.php + images/help/prediction_date.png + images/help/projection_periods.png + godmode/reporting/reporting_builder.item_editor.php: Added + contextual help. Forgot to update Changelog. + 2011-10-28 Sergio Martin * extensions/snmp_explorer.php: Improved snmp explorer to use diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 84e1718635..bb43ef143f 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -158,7 +158,7 @@ if ($update_component) { $custom_string_1 = ''; $custom_string_2 = ''; $custom_string_3 = ''; - $name_check = db_get_value ('name', 'tnetwork_component', 'name', $name); + //$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name); if ($type >= 15 && $type <= 18) { // New support for snmp v3 $tcp_send = $snmp_version; @@ -168,9 +168,9 @@ if ($update_component) { $custom_string_1 = $snmp3_privacy_method; $custom_string_2 = $snmp3_privacy_pass; $custom_string_3 = $snmp3_security_level; - $name_check = db_get_value ('name', 'tnetwork_component', 'name', $name); + //$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name); } - if ($name && !$name_check) { + if (!empty($name)) { $result = network_components_update_network_component ($id, array ('type' => $type, 'name' => $name, diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index a3137072d2..18de91c704 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -128,7 +128,7 @@ else if ($id_component_type == 4) { require ("godmode/modules/manage_network_components_form_common.php"); require ("godmode/modules/manage_network_components_form_plugin.php"); } -else if ($id_component_type == 2) { +else if ($id_component_type == 2) { $categories = array (3, 4, 5); require ("godmode/modules/manage_network_components_form_common.php"); require ("godmode/modules/manage_network_components_form_network.php"); @@ -193,7 +193,7 @@ function type_change () { document.component.snmp3_security_level.disabled=true; } // type 15-18- SNMP - if ((document.component.type.value > 14) && (document.component.type.value < 19 )) { + if ((document.component.type.value > 14) && (document.component.type.value < 19 )) { document.component.snmp_oid.style.background="#fff"; document.component.snmp_oid.style.disabled=false; document.component.snmp_community.style.background="#fff"; @@ -309,6 +309,114 @@ function type_change () { document.component.snmp3_security_level.disabled=true; } } + +$(document).ready (function () { + $("#snmp_version").change(function () { + if (this.value == "3") { + $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_user]").attr("disabled", false); + + $("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_pass]").attr("disabled", false); + + $("#snmp3_privacy_method").css({backgroundColor: '#fff'}); + $("#snmp3_privacy_method").attr("disabled", false); + + $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_privacy_pass]").attr("disabled", false); + + $("#snmp3_auth_method").css({backgroundColor: '#fff'}); + $("#snmp3_auth_method").attr("disabled", false); + + $("#snmp3_security_level").css({backgroundColor: '#fff'}); + $("#snmp3_security_level").attr("disabled", false); + + $("input[name=active_snmp_v3]").val(1); + $("input[name=snmp_community]").css({backgroundColor: '#ddd'}); + $("input[name=snmp_community]").attr("disabled",true); + } + else { + $("input[name=snmp3_auth_user]").val(""); + $("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_auth_user]").attr("disabled", true); + + $("input[name=snmp3_auth_pass]").val(""); + $("input[name=snmp3_auth_pass]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_auth_pass]").attr("disabled", true); + + $("#snmp3_privacy_method").css({backgroundColor: '#ddd'}); + $("#snmp3_privacy_method").attr("disabled", true); + + $("input[name=snmp3_privacy_pass]").val(""); + $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_privacy_pass]").attr("disabled", true); + + $("#snmp3_auth_method").css({backgroundColor: '#ddd'}); + $("#snmp3_auth_method").attr("disabled", true); + + $("#snmp3_security_level").css({backgroundColor: '#ddd'}); + $("#snmp3_security_level").attr("disabled", true); + + $("input[name=active_snmp_v3]").val(0); + $("input[name=snmp_community]").css({backgroundColor: '#fff'}); + $("input[name=snmp_community]").attr("disabled", false); + + + } + }); + + $("#type"). change(function () { + if ($("#snmp_version").value == "3") { + $("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_user]").attr("disabled", false); + + $("input[name=snmp3_auth_pass]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_auth_pass]").attr("disabled", false); + + $("#snmp3_privacy_method").css({backgroundColor: '#fff'}); + $("#snmp3_privacy_method").attr("disabled", false); + + $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#fff'}); + $("input[name=snmp3_privacy_pass]").attr("disabled", false); + + $("#snmp3_auth_method").css({backgroundColor: '#fff'}); + $("#snmp3_auth_method").attr("disabled", false); + + $("#snmp3_security_level").css({backgroundColor: '#fff'}); + $("#snmp3_security_level").attr("disabled", false); + + $("input[name=active_snmp_v3]").val(1); + $("input[name=snmp_community]").css({backgroundColor: '#ddd'}); + $("input[name=snmp_community]").attr("disabled",true); + }else{ + $("input[name=snmp3_auth_user]").val(""); + $("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_auth_user]").attr("disabled", true); + + $("input[name=snmp3_auth_pass]").val(""); + $("input[name=snmp3_auth_pass]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_auth_pass]").attr("disabled", true); + + $("#snmp3_privacy_method").css({backgroundColor: '#ddd'}); + $("#snmp3_privacy_method").attr("disabled", true); + + $("input[name=snmp3_privacy_pass]").val(""); + $("input[name=snmp3_privacy_pass]").css({backgroundColor: '#ddd'}); + $("input[name=snmp3_privacy_pass]").attr("disabled", true); + + $("#snmp3_auth_method").css({backgroundColor: '#ddd'}); + $("#snmp3_auth_method").attr("disabled", true); + + $("#snmp3_security_level").css({backgroundColor: '#ddd'}); + $("#snmp3_security_level").attr("disabled", true); + + $("input[name=active_snmp_v3]").val(0); + $("input[name=snmp_community]").css({backgroundColor: '#fff'}); + $("input[name=snmp_community]").attr("disabled", false); + } + }); +}); + type_change (); 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 f20d016c73..79f7cb333e 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_network.php +++ b/pandora_console/godmode/modules/manage_network_components_form_network.php @@ -66,7 +66,7 @@ push_table_row($data, 'field_snmpv3_row1'); $data = array(); $data[0] = __('Privacy method'); $data[1] = html_print_select(array('DES' => __('DES'), 'AES' => __('AES')), 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true); -$data[2] = __('privacy pass'); +$data[2] = __('Privacy pass'); $data[3] = html_print_input_text ('snmp3_privacy_pass', $snmp3_privacy_pass, '', 15, 60, true); push_table_row($data, 'field_snmpv3_row2'); @@ -101,3 +101,4 @@ $table->colspan['tcp_receive'][1] = 3; push_table_row ($data, 'tcp_receive'); ?> +