From 77f57ae87f290080d28d649dc475f99cf013feeb Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Thu, 8 Aug 2019 09:23:23 +0200 Subject: [PATCH] Don't allow access to update manager offline in community edition - #4484 --- .../update_manager/update_manager.offline.php | 5 ++++ .../godmode/update_manager/update_manager.php | 24 ++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/pandora_console/godmode/update_manager/update_manager.offline.php b/pandora_console/godmode/update_manager/update_manager.offline.php index 24da1a341f..8eff08d996 100644 --- a/pandora_console/godmode/update_manager/update_manager.offline.php +++ b/pandora_console/godmode/update_manager/update_manager.offline.php @@ -31,6 +31,11 @@ global $config; check_login(); +if (!enterprise_installed()) { + include 'general/noaccess.php'; + exit; +} + if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user']) ) { diff --git a/pandora_console/godmode/update_manager/update_manager.php b/pandora_console/godmode/update_manager/update_manager.php index 7954fd0ada..6b5d6f3cdd 100644 --- a/pandora_console/godmode/update_manager/update_manager.php +++ b/pandora_console/godmode/update_manager/update_manager.php @@ -30,19 +30,21 @@ if ($php_version_array[0] < 7) { $tab = get_parameter('tab', 'online'); -$buttons = [ - 'setup' => [ - 'active' => ($tab == 'setup') ? true : false, - 'text' => ''.html_print_image('images/gm_setup.png', true, ['title' => __('Options')]).'', - ], - 'offline' => [ +$buttons['setup'] = [ + 'active' => ($tab == 'setup') ? true : false, + 'text' => ''.html_print_image('images/gm_setup.png', true, ['title' => __('Options')]).'', +]; + +if (enterprise_installed()) { + $buttons['offline'] = [ 'active' => ($tab == 'offline') ? true : false, 'text' => ''.html_print_image('images/box.png', true, ['title' => __('Offline update manager')]).'', - ], - 'online' => [ - 'active' => ($tab == 'online') ? true : false, - 'text' => ''.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager')]).'', - ], + ]; +} + +$buttons['online'] = [ + 'active' => ($tab == 'online') ? true : false, + 'text' => ''.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager')]).'', ];