diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ea5af6b5ff..515219cd60 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-11-30 Juan Manuel Ramon + + * include/functions_agents.php: Fixed bad sql sintax in + agents_get_agents funtion. + + Fixes: #3445995 + 2011-11-30 Juan Manuel Ramon * operation/agentes/estado_generalagente.php diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 3ce63905c6..9c875d1732 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -388,8 +388,11 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o } } - if($extra) { - $where = sprintf('%s AND (%s OR %s)', $where, $where_nogroup, $sql_extra); + if($extra) { + if (empty($where_nogroup)) + $where = sprintf('%s AND (%s)', $where, $sql_extra); + else + $where = sprintf('%s AND (%s OR %s)', $where, $where_nogroup, $sql_extra); } else { $where = sprintf('%s AND %s', $where, $where_nogroup);