2011-02-18 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_db.php, operation/search_modules.php,
	operation/search_agents.php: fixed SQL querys, this querys in previous
	version haven't lines SQL code for to search into subgroups.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3925 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-02-18 14:41:52 +00:00
parent 79fbcd9b75
commit 9990475faf
4 changed files with 106 additions and 19 deletions

View File

@ -1,3 +1,9 @@
2011-02-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_db.php, operation/search_modules.php,
operation/search_agents.php: fixed SQL querys, this querys in previous
version haven't lines SQL code for to search into subgroups.
2011-02-18 Javier Lanz <javier.lanz@artica.es>
* operation/servers/view_server.php: Fixed ACL permissions

View File

@ -714,12 +714,39 @@ function get_agent_modules ($id_agent = null, $details = false, $filter = false,
SELECT id_agente
FROM tagente
WHERE 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
SELECT id_grupo
FROM tgrupo
WHERE 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 (
parent 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 1 = (
SELECT propagate
FROM tgrupo
WHERE 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
)
)
)
)
)
)

View File

@ -116,13 +116,40 @@ if ($searchAgents) {
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
)
SELECT id_grupo
FROM tagente
WHERE 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 (
parent 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 1 = (
SELECT propagate
FROM tgrupo
WHERE 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

View File

@ -64,12 +64,39 @@ if ($searchModules) {
INNER JOIN tagente_estado AS t4
ON t4.id_agente_modulo = t1.id_agente_modulo
WHERE (t2.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
SELECT id_grupo
FROM tgrupo
WHERE 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 (
parent 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 1 = (
SELECT propagate
FROM tgrupo
WHERE 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 (