diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1496c59c40..9109f25cb8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2011-01-27 Miguel de Dios + + * operation/search_agents.php: refixed the order of parentheses. + 2011-01-26 Sancho Lerena * ssh_console: new ssh extension (agent tab extension) it will exec a diff --git a/pandora_console/operation/search_agents.php b/pandora_console/operation/search_agents.php index 474af4689d..16a490f340 100755 --- a/pandora_console/operation/search_agents.php +++ b/pandora_console/operation/search_agents.php @@ -106,38 +106,38 @@ switch ($sortField) { $agents = false; if ($searchAgents) { $sql = " - FROM tagente AS t1 - INNER JOIN tgrupo AS t2 - ON t2.id_grupo = t1.id_grupo - WHERE - (1 = ( - SELECT is_admin FROM tusuario WHERE id_user = '" . $config['id_user'] . "' - ) - ) - OR - (t1.id_grupo IN ( - SELECT id_grupo - FROM tusuario_perfil - WHERE id_usuario = '" . $config['id_user'] . "' - AND id_perfil IN ( - SELECT id_perfil - FROM tperfil WHERE agent_view = 1 - ) - ) - OR 0 IN ( - SELECT id_grupo - FROM tusuario_perfil - WHERE id_usuario = '" . $config['id_user'] . "' - AND id_perfil IN ( - SELECT id_perfil - FROM tperfil WHERE agent_view = 1 - ) - ) - ) - AND ( - t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR - t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' - ) + FROM tagente AS t1 + INNER JOIN tgrupo AS t2 + ON t2.id_grupo = t1.id_grupo + WHERE ( + 1 = ( + SELECT is_admin + FROM tusuario + WHERE id_user = '" . $config['id_user'] . "' + ) + OR t1.id_grupo IN ( + SELECT id_grupo + FROM tusuario_perfil + WHERE id_usuario = '" . $config['id_user'] . "' + AND id_perfil IN ( + SELECT id_perfil + FROM tperfil WHERE agent_view = 1 + ) + ) + OR 0 IN ( + SELECT id_grupo + FROM tusuario_perfil + WHERE id_usuario = '" . $config['id_user'] . "' + AND id_perfil IN ( + SELECT id_perfil + FROM tperfil WHERE agent_view = 1 + ) + ) + ) + AND ( + t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR + t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' + ) ";