mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-25 19:09:08 +02:00
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>
|
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
|
* include/functions_agents.php: Call to get_agents () with current user
|
||||||
and without returning "all" group, this avoid to render non-visible (ACL)
|
and without returning "all" group, this avoid to render non-visible (ACL)
|
||||||
agents in the AJAX control to return an agent.
|
agents in the AJAX control to return an agent.
|
||||||
|
@ -44,6 +44,8 @@ function get_user_custom_graphs ($id_user = 0, $only_names = false) {
|
|||||||
$id_user = $config['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');
|
$all_graphs = get_db_all_rows_in_table ('tgraph', 'name');
|
||||||
if ($all_graphs === false)
|
if ($all_graphs === false)
|
||||||
return array ();
|
return array ();
|
||||||
@ -53,6 +55,11 @@ function get_user_custom_graphs ($id_user = 0, $only_names = false) {
|
|||||||
if ($graph["id_user"] != $id_user && $graph['private'])
|
if ($graph["id_user"] != $id_user && $graph['private'])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ($graph["id_group"] > 0)
|
||||||
|
if (!isset($groups[$graph["id_group"]])){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($only_names) {
|
if ($only_names) {
|
||||||
$graphs[$graph['id_graph']] = $graph['name'];
|
$graphs[$graph['id_graph']] = $graph['name'];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user