From 7e2fb25e2746d23ffd5382f763e87a2052ed02c8 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 24 Dec 2018 08:59:23 +0100 Subject: [PATCH 1/2] fixed errors in massive operation edit modules Former-commit-id: 2d2fa21660369607e6c206d269b12d2041f74a1a --- .../godmode/massive/massive_edit_modules.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index f09d495c0a..35d5bd1abc 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -51,31 +51,27 @@ if ($update) { $agents_ = array(); $force = get_parameter('force_type', false); - + if ($agents_select == false) { $agents_select = array(); } - - foreach ($agents_select as $agent_name) { - $agents_[] = agents_get_agent_id($agent_name); - } + $agents_ = $agents_select; $modules_ = $module_name; - } else if ($selection_mode == 'agents') { $force = get_parameter('force_group', false); - + $agents_ = $agents_id; $modules_ = $modules_select; } - + $success = 0; $count = 0; - + if ($agents_ == false) $agents_ = array(); - + // If the option to select all of one group or module type is checked if ($force) { if ($force == 'type') { From ac228a7fad7a8c4cf709eeb2f9270a288664c0c7 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 28 Dec 2018 12:14:17 +0100 Subject: [PATCH 2/2] fixed error in massive operation Former-commit-id: 691f3557d44c686645cfa634eab3630d060def33 --- pandora_console/godmode/massive/massive_delete_modules.php | 2 +- pandora_console/include/functions_agents.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index 8462d75b7e..74860bb50f 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -285,7 +285,7 @@ else { $filter = false; } $names = agents_get_modules (array_keys ($agents), - 'DISTINCT(tagente_modulo.nombre)', $filter, false); + 'tagente_modulo.nombre', $filter, false); foreach ($names as $name) { $modules[$name['nombre']] = $name['nombre']; } diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index d69a27d8fe..b10251b9b2 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1231,8 +1231,8 @@ function agents_get_modules ($id_agent = null, $details = false, ON tagente.id_agente = tasg.id_agent WHERE tagente_modulo.delete_pending = 0 AND %s - GROUP BY tagente_modulo.id_agente_modulo - ORDER BY tagente_modulo.nombre', + GROUP BY 1 + ORDER BY 1', ($details != 'tagente_modulo.*' && $indexed) ? 'tagente_modulo.id_agente_modulo,' : '', io_safe_output(implode (",", (array) $details)), $sql_tags_join,