From d4468120186cb72b3357ea4af90be6c15bc84fc7 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 27 Apr 2023 16:39:13 +0200 Subject: [PATCH] #986 changed behavior for ip custom when change with politic --- .../agentes/module_manager_editor_network.php | 13 ++++++------- .../godmode/agentes/module_manager_editor_wmi.php | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 464fff7c67..c97be2007f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -89,14 +89,9 @@ push_table_simple($data, 'caption_target_ip'); $data = []; // Show agent_for defect. if ($page === 'enterprise/godmode/policies/policy_modules') { - if (empty($ip_target) === false && $ip_target !== 'auto') { + if ($ip_target !== 'auto' && $ip_target !== 'force_pri') { $custom_ip_target = $ip_target; $ip_target = 'custom'; - } else if (empty($ip_target) === true) { - $ip_target = 'force_pri'; - $custom_ip_target = ''; - } else { - $custom_ip_target = ''; } $target_ip_values = []; @@ -720,9 +715,13 @@ $(document).ready (function () { }); var custom_ip_target = ""; - if(custom_ip_target == ''){ + var ip_target = ""; + if(ip_target === 'custom'){ + $("#text-custom_ip_target").show(); + } else { $("#text-custom_ip_target").hide(); } + $('#ip_target').change(function() { if($(this).val() === 'custom') { $("#text-custom_ip_target").show(); diff --git a/pandora_console/godmode/agentes/module_manager_editor_wmi.php b/pandora_console/godmode/agentes/module_manager_editor_wmi.php index 3b3f539f08..13c091a937 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_wmi.php +++ b/pandora_console/godmode/agentes/module_manager_editor_wmi.php @@ -43,14 +43,9 @@ if (empty($edit_module)) { $data = []; if ($page == 'enterprise/godmode/policies/policy_modules') { - if ($ip_target != 'auto' && $ip_target != '') { + if ($ip_target !== 'auto' && $ip_target !== 'force_pri') { $custom_ip_target = $ip_target; $ip_target = 'custom'; - } else if ($ip_target == '') { - $ip_target = 'force_pri'; - $custom_ip_target = ''; - } else { - $custom_ip_target = ''; } $target_ip_values = []; @@ -240,9 +235,13 @@ push_table_simple($data, 'key_field');