From a354ebcf48bc6c701814c433bcbf97005beb9284 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Fri, 25 Nov 2011 11:11:36 +0000 Subject: [PATCH] 2011-11-25 Juan Manuel Ramon * include/functions_agents.php: Fixed sql error in agents_get_agents function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5171 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_agents.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c848575b89..c1eda882f4 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-11-25 Juan Manuel Ramon + + * include/functions_agents.php: Fixed sql error in agents_get_agents + function. + 2011-11-25 Juan Manuel Ramon * godmode/agentes/module_manager.php: Fixed an sql error. diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index e8b3bb678a..c094b6b5b5 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -315,7 +315,7 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o if (! is_array ($filter)) { $filter = array (); } - + //Get user groups $groups = array_keys (users_get_groups ($config["id_user"], $access, false)); @@ -377,6 +377,7 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o $sql_extra = enterprise_hook('policies_get_agents_sql_condition'); if($sql_extra != ENTERPRISE_NOT_HOOK) { + if (!empty($sql_extra)) $where = sprintf('%s OR %s', $where, $sql_extra); }