2011-01-27 Miguel de Dios <miguel.dedios@artica.es>

* operation/search_agents.php: refixed the order of parentheses.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3782 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-01-27 12:27:06 +00:00
parent a6c7692c67
commit 9419fea0a4
2 changed files with 36 additions and 32 deletions

View File

@ -1,3 +1,7 @@
2011-01-27 Miguel de Dios <miguel.dedios@artica.es>
* operation/search_agents.php: refixed the order of parentheses.
2011-01-26 Sancho Lerena <slerena@artica.es> 2011-01-26 Sancho Lerena <slerena@artica.es>
* ssh_console: new ssh extension (agent tab extension) it will exec a * ssh_console: new ssh extension (agent tab extension) it will exec a

View File

@ -106,38 +106,38 @@ switch ($sortField) {
$agents = false; $agents = false;
if ($searchAgents) { if ($searchAgents) {
$sql = " $sql = "
FROM tagente AS t1 FROM tagente AS t1
INNER JOIN tgrupo AS t2 INNER JOIN tgrupo AS t2
ON t2.id_grupo = t1.id_grupo ON t2.id_grupo = t1.id_grupo
WHERE WHERE (
(1 = ( 1 = (
SELECT is_admin FROM tusuario WHERE id_user = '" . $config['id_user'] . "' SELECT is_admin
) FROM tusuario
) WHERE id_user = '" . $config['id_user'] . "'
OR )
(t1.id_grupo IN ( OR t1.id_grupo IN (
SELECT id_grupo SELECT id_grupo
FROM tusuario_perfil FROM tusuario_perfil
WHERE id_usuario = '" . $config['id_user'] . "' WHERE id_usuario = '" . $config['id_user'] . "'
AND id_perfil IN ( AND id_perfil IN (
SELECT id_perfil SELECT id_perfil
FROM tperfil WHERE agent_view = 1 FROM tperfil WHERE agent_view = 1
) )
) )
OR 0 IN ( OR 0 IN (
SELECT id_grupo SELECT id_grupo
FROM tusuario_perfil FROM tusuario_perfil
WHERE id_usuario = '" . $config['id_user'] . "' WHERE id_usuario = '" . $config['id_user'] . "'
AND id_perfil IN ( AND id_perfil IN (
SELECT id_perfil SELECT id_perfil
FROM tperfil WHERE agent_view = 1 FROM tperfil WHERE agent_view = 1
) )
) )
) )
AND ( AND (
t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%'
) )
"; ";