2013-11-12 Vanessa Gil <vanessa.gil@artica.es>

* operation/agentes/status_monitor.php: Fixed search filter
	in Monitor view.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9062 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2013-11-12 12:38:13 +00:00
parent cb8f12e1c6
commit 4a6273da91
2 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2013-11-12 Vanessa Gil <vanessa.gil@artica.es>
* operation/agentes/status_monitor.php: Fixed search filter
in Monitor view.
2013-11-12 Sergio Martin <sergio.martin@artica.es>
* include/javascript/pandora.js: Fix ugly chars in the

View File

@ -57,8 +57,8 @@ else {
$offset = (int) get_parameter ('offset', 0);
$status = (int) get_parameter ('status', 4);
$modulegroup = (int) get_parameter ('modulegroup', -1);
$tag_filter = (int) get_parameter('tag_filter', 0);
$modulegroup = get_parameter ('modulegroup', -1);
$tag_filter = get_parameter('tag_filter', 0);
$refr = get_parameter('refr', 0);
// Sort functionality
@ -92,10 +92,13 @@ $sql_conditions_base = " WHERE tagente.id_agente = tagente_modulo.id_agente
$sql_conditions = " AND tagente_modulo.disabled = 0 AND tagente.disabled = 0";
$id_ag_group = db_get_value('id_grupo', 'tgrupo', 'nombre', $ag_group);
// Agent group selector
if (!defined('METACONSOLE')) {
if ($ag_group > 0 && check_acl ($config["id_user"], $ag_group, "AR")) {
$sql_conditions_group = sprintf (" AND tagente.id_grupo = %d", $ag_group);
if ($ag_group > 0 && check_acl ($config["id_user"], $id_ag_group, "AR")) {
$sql_conditions_group = sprintf (" AND tagente.id_grupo = %d", $id_ag_group);
}
elseif ($user_groups != '') {
// User has explicit permission on group 1 ?
@ -103,7 +106,7 @@ if (!defined('METACONSOLE')) {
}
}
else {
if ($ag_group != "0" && check_acl ($config["id_user"], $ag_group, "AR")) {
if ($ag_group != "0" && check_acl ($config["id_user"], $id_ag_group, "AR")) {
$sql_conditions_group = sprintf (" AND tagente.id_grupo IN ( SELECT id_grupo FROM tgrupo where nombre = '%s') ", $ag_group);
}
elseif ($user_groups != '') {
@ -111,7 +114,6 @@ else {
$sql_conditions_group = " AND tagente.id_grupo IN (".$user_groups.")";
}
}
// Module group
if (defined('METACONSOLE')) {
if ($modulegroup != '-1')
@ -119,7 +121,9 @@ if (defined('METACONSOLE')) {
FROM tmodule_group WHERE name = '%s')", $modulegroup);
}
else if ($modulegroup > -1) {
$sql_conditions .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
$id_modulegroup = db_get_value('id_agente_modulo', 'tagente_modulo', 'nombre', $modulegroup);
$sql_conditions .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $id_modulegroup);
}
@ -169,10 +173,11 @@ if ($tag_filter !== 0) {
)";
}
else{
$id_tag_filter = db_get_value('id_tag', 'ttag', 'name', $tag_filter);
$sql_conditions .= " AND tagente_modulo.id_agente_modulo IN (
SELECT ttag_module.id_agente_modulo
FROM ttag_module
WHERE ttag_module.id_tag = " . $tag_filter . "
WHERE ttag_module.id_tag = " . $id_tag_filter . "
)";
}