diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 598f31ee26..d502a96cad 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,5 +1,7 @@ 2010-08-26 Sancho Lerena + * include/functions_custom_graphs.php: Fixed ACL problems. + * include/functions_agents.php: Call to get_agents () with current user and without returning "all" group, this avoid to render non-visible (ACL) agents in the AJAX control to return an agent. diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index bc49db1f0e..84f62dc731 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -43,6 +43,8 @@ function get_user_custom_graphs ($id_user = 0, $only_names = false) { if (!$id_user) { $id_user = $config['id_user']; } + + $groups = get_user_groups ($id_user, "AR", false); $all_graphs = get_db_all_rows_in_table ('tgraph', 'name'); if ($all_graphs === false) @@ -52,7 +54,12 @@ function get_user_custom_graphs ($id_user = 0, $only_names = false) { foreach ($all_graphs as $graph) { if ($graph["id_user"] != $id_user && $graph['private']) continue; - + + if ($graph["id_group"] > 0) + if (!isset($groups[$graph["id_group"]])){ + continue; + } + if ($only_names) { $graphs[$graph['id_graph']] = $graph['name']; }