From 3e4a7bfdbf4bf5864b75e6c4362fb9b03bd56d43 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 9 Apr 2019 09:51:03 +0200 Subject: [PATCH] fixed error autocomplete input module Former-commit-id: c9fca2ba51b3b0872d39e658f18c5d3c5e917dbd --- pandora_console/include/functions_html.php | 28 ++-------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 4a24d5a964..30b86478f8 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2744,28 +2744,7 @@ function html_print_autocomplete_modules( global $config; if ($id_agents === false) { - $groups = []; - if ($ACL) { - $groups = users_get_groups($config['id_user'], 'AW', false); - $groups = array_keys($groups); - - if (empty($groups)) { - $id_groups = 0; - } else { - $id_groups = implode(',', $groups); - } - - $agents = db_get_all_rows_sql( - 'SELECT id_agente - FROM tagente - WHERE id_grupo IN ('.$id_groups.')' - ); - } else { - $agents = db_get_all_rows_sql( - 'SELECT id_agente - FROM tagente' - ); - } + $agents = agents_get_agents(); if ($agents === false) { $agents = []; @@ -2777,10 +2756,7 @@ function html_print_autocomplete_modules( } } else { if ($ACL) { - $groups = users_get_groups($config['id_user'], 'AW', false); - $groups = array_keys($groups); - - $agents = db_get_all_rows_sql('SELECT id_agente FROM tagente WHERE id_grupo IN ('.implode(',', $groups).')'); + $agents = agents_get_agents(); if ($agents === false) { $agents = [];