From 77db5e5cc5c0d940f7fdca3a12cddd2395ae7bd1 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Wed, 30 Nov 2011 15:04:43 +0000 Subject: [PATCH] 2011-11-30 Juan Manuel Ramon * include/functions_agents.php: Fixed bad sql sintax in agents_get_agents function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5216 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_agents.php | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 515219cd60..e2e5fcc053 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-11-30 Juan Manuel Ramon + + * include/functions_agents.php: Fixed bad sql sintax in + agents_get_agents function. + 2011-11-30 Juan Manuel Ramon * include/functions_agents.php: Fixed bad sql sintax in diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 9c875d1732..ad15ed3a47 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -376,7 +376,7 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o } $where = db_format_array_where_clause_sql ($filter, 'AND', ''); - + $where_nogroup = db_format_array_where_clause_sql ($filter_nogroup, 'AND', ''); $sql_extra = enterprise_hook('policies_get_agents_sql_condition'); @@ -395,7 +395,8 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o $where = sprintf('%s AND (%s OR %s)', $where, $where_nogroup, $sql_extra); } else { - $where = sprintf('%s AND %s', $where, $where_nogroup); + if (!empty($where_nogroup)) + $where = sprintf('%s AND %s', $where, $where_nogroup); } $sql = sprintf('SELECT %s FROM tagente WHERE %s %s', implode(',',$fields), $where, $order);