2013-10-10 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_tags.php,
	operation/agentes/estado_monitores.php,
	operation/agentes/status_events.php: uploaded the fixes of Juanma.
	Thanks Juanma ;) 




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8885 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-10-10 12:55:22 +00:00
parent 02380b76d8
commit 74a4ef7b83
4 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2013-10-10 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_tags.php,
operation/agentes/estado_monitores.php,
operation/agentes/status_events.php: uploaded the fixes of Juanma.
Thanks Juanma ;)
2013-10-10 Sergio Martin <sergio.martin@artica.es>
* include/styles/pandora.css

View File

@ -767,11 +767,18 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') {
}
$condition = '';
// Fix: Wrap SQL expression with "()" to avoid bad SQL sintax that makes Pandora retrieve all modules without taking care of id_agent => id_agent = X AND (sql_tag_expression)
$i = 0;
foreach ($acltags as $group_id => $group_tags) {
if ($condition != '') {
$condition .= ' OR ';
}
// Fix: Wrap SQL expression with "()" to avoid bad SQL sintax that makes Pandora retrieve all modules without taking care of id_agent => id_agent = X AND (sql_tag_expression)
if ($i == 0)
$condition .= ' ( ';
// Group condition (The module belongs to an agent of the group X)
if (!array_key_exists(0, array_keys($acltags))) {
$group_condition = sprintf('%sid_agente IN (SELECT id_agente FROM tagente WHERE id_grupo = %d)', $modules_table, $group_id);
@ -784,8 +791,14 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table = '') {
$tags_condition = sprintf('%sid_agente_modulo IN (SELECT id_agente_modulo FROM ttag_module WHERE id_tag IN (%s))', $modules_table, implode(',',$group_tags));
$condition .= "($group_condition AND \n$tags_condition)\n";
$i++;
}
// Fix: Wrap SQL expression with "()" to avoid bad SQL sintax that makes Pandora retrieve all modules without taking care of id_agent => id_agent = X AND (sql_tag_expression)
if (!empty($acltags))
$condition .= ' ) ';
//Avoid the user profiles with all group access.
//if (!empty($condition)) {
if (!empty($condition) &&

View File

@ -152,8 +152,11 @@ switch ($config["dbtype"]) {
break;
}
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]);
$tags_sql = tags_get_acl_tags($config['id_user'],
$agent['id_grupo'], 'AR', 'module_condition', 'AND', 'tagente_modulo');
array_keys($groups), 'AR', 'module_condition', 'AND', 'tagente_modulo');
$status_filter_monitor = (int)get_parameter('status_filter_monitor', -1);
$status_text_monitor = get_parameter('status_text_monitor', '');

View File

@ -26,7 +26,10 @@ require_once ("include/functions_events.php");
echo "<h4 style='margin-top:0px !important;'>".__('Latest events for this agent')."</h4>";
$tags_condition = tags_get_acl_tags($config['id_user'], $agent['id_grupo'], 'ER', 'event_condition', 'AND');
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]);
$tags_condition = tags_get_acl_tags($config['id_user'], /*$agent['id_grupo']*/ array_keys($groups), 'ER', 'event_condition', 'AND');
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%', false, $id_agente);