From 97392c4568c668b9ca7484b3034958893c4136ac Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 7 Aug 2017 13:10:02 +0200 Subject: [PATCH] Fixed issue to search agent modules in cascade protection --- pandora_console/godmode/agentes/agent_manager.php | 4 ++-- pandora_console/godmode/massive/massive_edit_agents.php | 4 ++-- pandora_console/include/ajax/module.php | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 7042b0d15b..2db2e53e93 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -580,11 +580,11 @@ ui_require_jquery_file('bgiframe'); }); $("#text-id_parent").on("autocompletechange", function () { - agent_name = $("#text-id_parent").val(); + agent_id=$("#hidden-id_parent").val(); var params = {}; params["get_agent_modules_json_by_name"] = 1; - params["agent_name"] = agent_name; + params["id_agent"] = agent_id; params["page"] = "include/ajax/module"; jQuery.ajax ({ diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 802dc67e6b..cab81fd1c4 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -558,11 +558,11 @@ $(document).ready (function () { }); $("#text-id_parent").on("autocompletechange", function () { - agent_name = $("#text-id_parent").val(); + agent_id = $("#hidden-id_parent").val(); var params = {}; params["get_agent_modules_json_by_name"] = 1; - params["agent_name"] = agent_name; + params["id_agent"] = agent_id; params["page"] = "include/ajax/module"; jQuery.ajax ({ diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index d18a8ec97d..ccc4b53e2b 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -38,9 +38,7 @@ $get_agent_modules_json_by_name = (bool) get_parameter('get_agent_modules_json_b if ($get_agent_modules_json_by_name) { - $agent_name = get_parameter('agent_name'); - - $agent_id = agents_get_agent_id($agent_name); + $agent_id = get_parameter('id_agent'); $agent_modules = db_get_all_rows_sql("SELECT id_agente_modulo as id_module, nombre as name FROM tagente_modulo WHERE id_agente = " . $agent_id);