2014-06-17 Sergio Martin <sergio.martin@artica.es>
* include/functions_menu.php: Fix ACLs limitations. Now its possible give access to any submenu option without have access to the first one. Ticket: #856 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10214 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4a3ff7118d
commit
a7dd8b6845
|
@ -1,3 +1,9 @@
|
|||
2014-06-17 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_menu.php: Fix ACLs limitations. Now its possible
|
||||
give access to any submenu option without have access to the first one.
|
||||
Ticket: #856
|
||||
|
||||
2014-06-17 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* godmode/agentes/planned_downtime.editor.php: Changed
|
||||
|
|
|
@ -91,6 +91,9 @@ function menu_print_menu (&$menu) {
|
|||
$submenu_output = '';
|
||||
|
||||
$count_sub = 0;
|
||||
$count_sub_access = 0;
|
||||
$first_sub_sec2 = '';
|
||||
|
||||
foreach ($main["sub"] as $subsec2 => $sub) {
|
||||
$count_sub++;
|
||||
|
||||
|
@ -104,6 +107,13 @@ function menu_print_menu (&$menu) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// We store the first subsection to use it if the main section has not access
|
||||
if ($count_sub_access == 0) {
|
||||
$first_sub_sec2 = $subsec2;
|
||||
}
|
||||
|
||||
$count_sub_access++;
|
||||
|
||||
$class = '';
|
||||
|
||||
$selected_submenu2 = false;
|
||||
|
@ -321,7 +331,13 @@ function menu_print_menu (&$menu) {
|
|||
|
||||
// Choose valid section (sec)
|
||||
if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec, $main["sec2"])) == false){
|
||||
continue;
|
||||
if ($count_sub_access > 0) {
|
||||
// If any susection have access but main section not, we change main link to first subsection found
|
||||
$main["sec2"] = $first_sub_sec2;
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//Print out the first level
|
||||
|
|
Loading…
Reference in New Issue