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:
zarzuelo 2014-06-17 09:59:29 +00:00
parent 4a3ff7118d
commit a7dd8b6845
2 changed files with 23 additions and 1 deletions

View File

@ -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> 2014-06-17 Vanessa Gil <vanessa.gil@artica.es>
* godmode/agentes/planned_downtime.editor.php: Changed * godmode/agentes/planned_downtime.editor.php: Changed

View File

@ -91,6 +91,9 @@ function menu_print_menu (&$menu) {
$submenu_output = ''; $submenu_output = '';
$count_sub = 0; $count_sub = 0;
$count_sub_access = 0;
$first_sub_sec2 = '';
foreach ($main["sub"] as $subsec2 => $sub) { foreach ($main["sub"] as $subsec2 => $sub) {
$count_sub++; $count_sub++;
@ -104,6 +107,13 @@ function menu_print_menu (&$menu) {
continue; 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 = ''; $class = '';
$selected_submenu2 = false; $selected_submenu2 = false;
@ -321,7 +331,13 @@ function menu_print_menu (&$menu) {
// Choose valid section (sec) // Choose valid section (sec)
if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec, $main["sec2"])) == false){ 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 //Print out the first level