From 4547cd105d8fd78363b035a4f4fdebc4cc21fe4e Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 15 Jun 2016 17:56:53 +0200 Subject: [PATCH] Hide new update manager menu to all users except PM --- pandora_console/godmode/menu.php | 47 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 8c696738f4..1dc369928e 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -403,34 +403,37 @@ foreach ($rows as $row) { $menu_godmode["links"]["sub"] = $sub; // Update Manager -$menu_godmode["messages"]["text"] = __('Update manager'); -$menu_godmode["messages"]["sec2"] = ""; -$menu_godmode["messages"]["id"] = "god-um_messages"; +if (check_acl ($config['id_user'], 0, "PM")) { + $menu_godmode["messages"]["text"] = __('Update manager'); + $menu_godmode["messages"]["sec2"] = ""; + $menu_godmode["messages"]["id"] = "god-um_messages"; -$sub = array (); -$sub["godmode/update_manager/update_manager&tab=offline"]["text"] = __('Offline'); -$sub["godmode/update_manager/update_manager&tab=offline"]["id"] = 'Offline'; -$sub["godmode/update_manager/update_manager&tab=online"]["text"] = __('Online'); -$sub["godmode/update_manager/update_manager&tab=online"]["id"] = 'Online'; -$sub["godmode/update_manager/update_manager&tab=setup"]["text"] = __('Options'); -$sub["godmode/update_manager/update_manager&tab=setup"]["id"] = 'Options'; - -if (license_free() && is_user_admin ($config['id_user'])) { + $sub = array (); + $sub["godmode/update_manager/update_manager&tab=offline"]["text"] = __('Offline'); + $sub["godmode/update_manager/update_manager&tab=offline"]["id"] = 'Offline'; + $sub["godmode/update_manager/update_manager&tab=online"]["text"] = __('Online'); + $sub["godmode/update_manager/update_manager&tab=online"]["id"] = 'Online'; + $sub["godmode/update_manager/update_manager&tab=setup"]["text"] = __('Options'); + $sub["godmode/update_manager/update_manager&tab=setup"]["id"] = 'Options'; + + if (license_free() && is_user_admin ($config['id_user'])) { + + include_once ("include/functions_update_manager.php"); + //If there are unread messages, display the notification icon + $number_total_messages; + $number_unread_messages = update_manager_get_unread_messages (); + if ($number_unread_messages > 0) { + $menu_godmode["messages"]["notification"] = $number_unread_messages; + } + + $sub["godmode/update_manager/update_manager&tab=messages"]["text"] = __('Messages'); + $sub["godmode/update_manager/update_manager&tab=messages"]["id"] = 'Messages'; - include_once ("include/functions_update_manager.php"); - //If there are unread messages, display the notification icon - $number_total_messages; - $number_unread_messages = update_manager_get_unread_messages (); - if ($number_unread_messages > 0) { - $menu_godmode["messages"]["notification"] = $number_unread_messages; } - $sub["godmode/update_manager/update_manager&tab=messages"]["text"] = __('Messages'); - $sub["godmode/update_manager/update_manager&tab=messages"]["id"] = 'Messages'; - + $menu_godmode["messages"]["sub"] = $sub; } -$menu_godmode["messages"]["sub"] = $sub; if (!$config['pure']) { menu_print_menu ($menu_godmode);