From 7d5b845e1fa213d10718f39a12d2d84cf2d243b1 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 28 Oct 2019 18:37:01 +0100 Subject: [PATCH] minor fixes --- .../godmode/agentes/module_manager_editor.php | 39 +++++++++++++++++++ .../include/javascript/pandora_modules.js | 22 +++++++---- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index d3ff659ff0..9db5fa0ed3 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -57,11 +57,50 @@ if (is_ajax()) { $component['plugin_pass'] ); + if ($component['type'] >= 15 + && $component['type'] <= 18 + ) { + // New support for snmp v3. + $component['snmp_version'] = $component['tcp_send']; + $component['snmp3_auth_user'] = io_safe_output( + $component['plugin_user'] + ); + // Must use io_output_password. + $component['snmp3_auth_pass'] = io_safe_output( + $component['plugin_pass'] + ); + $component['snmp3_auth_method'] = io_safe_output( + $component['plugin_parameter'] + ); + $component['snmp3_privacy_method'] = io_safe_output( + $component['custom_string_1'] + ); + $component['snmp3_privacy_pass'] = io_safe_output( + $component['custom_string_2'] + ); + $component['snmp3_security_level'] = io_safe_output( + $component['custom_string_3'] + ); + } else if ($component['type'] >= 34 + && $component['type'] <= 37 + ) { + $component['command_text'] = io_safe_output( + $component['tcp_send'] + ); + $component['command_credential_identifier'] = io_safe_output( + $component['custom_string_1'] + ); + $component['command_os'] = io_safe_output( + $component['custom_string_2'] + ); + } + $component['str_warning'] = io_safe_output($component['str_warning']); $component['str_critical'] = io_safe_output($component['str_critical']); $component['warning_inverse'] = (bool) $component['warning_inverse']; $component['critical_inverse'] = (bool) $component['critical_inverse']; + hd($component, true); echo io_json_mb_encode($component); return; } diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index d04c3d2bd6..0ba0eb5515 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -541,13 +541,13 @@ function configure_modules_form() { } if (data["type"] >= 15 && data["type"] <= 18) { - $("#snmp_version").val(data["tcp_send"]); - $("#text-snmp3_auth_user").val(data["plugin_user"]); - $("#password-snmp3_auth_pass").val(data["plugin_pass"]); - $("#snmp3_auth_method").val(data["plugin_parameter"]); - $("#snmp3_privacy_method").val(data["custom_string_1"]); - $("#password-snmp3_privacy_pass").val(data["custom_string_2"]); - $("#snmp3_security_level").val(data["custom_string_3"]); + $("#snmp_version").val(data["snmp_version"]); + $("#text-snmp3_auth_user").val(data["snmp3_auth_user"]); + $("#password-snmp3_auth_pass").val(data["snmp3_auth_pass"]); + $("#snmp3_auth_method").val(data["snmp3_auth_method"]); + $("#snmp3_privacy_method").val(data["snmp3_privacy_method"]); + $("#password-snmp3_privacy_pass").val(data["snmp3_privacy_pass"]); + $("#snmp3_security_level").val(data["snmp3_security_level"]); if (data["tcp_send"] == "3") { $("#simple-field_snmpv3_row1").attr("style", ""); @@ -564,6 +564,14 @@ function configure_modules_form() { if (data["id_plugin"] != undefined) { $("#id_plugin").trigger("change"); } + + if (data["type"] >= 34 && data["type"] <= 37) { + $("#command_text").val(data["command_text"]); + $("#command_credential_identifier").val( + data["command_credential_identifier"] + ); + $("#command_os").val(data["command_os"]); + } }, "json" );