diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1845f58038..bba30c4c8b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-01-26 Miguel de Dios + + * operation/agentes/status_monitor.php: fixed the ACL in the Module name for + the select box in the filter. + + * operation/search_agents.php: fixed the ACL in the search of agent. + 2011-01-26 Juan Manuel Ramon * include/functions_html.php: In print_image function checks if skin path is set for the current user and if it exists add it to the image path. diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 2fa028952a..3f0ed6025e 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -91,6 +91,11 @@ where nombre <> "delete_pending" and id_agente in from tperfil where agent_view = 1 ) ) + OR + (1 = ( + SELECT is_admin FROM tusuario WHERE id_user = "' . $config['id_user'] . '" + ) + ) OR 0 IN ( select id_grupo from tusuario_perfil diff --git a/pandora_console/operation/search_agents.php b/pandora_console/operation/search_agents.php index ead0989954..474af4689d 100755 --- a/pandora_console/operation/search_agents.php +++ b/pandora_console/operation/search_agents.php @@ -106,30 +106,39 @@ switch ($sortField) { $agents = false; if ($searchAgents) { $sql = " - FROM tagente AS t1 - INNER JOIN tgrupo - ON tgrupo.id_grupo = t1.id_grupo - WHERE (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 - tgrupo.nombre 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 . "%%' + ) + "; $select = "SELECT t1.id_agente, t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled";