2010-08-26 Sancho Lerena <slerena@gmail.com>
* include/functions_custom_graphs.php: Fixed ACL problems. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3185 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
724c0b96d3
commit
14a199bb19
|
@ -1,5 +1,7 @@
|
|||
2010-08-26 Sancho Lerena <slerena@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
|
|
@ -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'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue