diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 849ca6eb2f..e6258d88e7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2014-06-17 Sergio Martin + + * 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 * godmode/agentes/planned_downtime.editor.php: Changed diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 71f4795d93..0ab49638c5 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -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