From e39688e4c9a684e90df312d576786077462cdaba Mon Sep 17 00:00:00 2001 From: thom Date: Tue, 28 Jul 2020 13:28:07 +0200 Subject: [PATCH] Hide APS by default (First step to #5676) --- install/tpl/system.ini.master | 1 + interface/web/sites/lib/module.conf.php | 58 +++++++++++++------------ 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master index 81f6bba553..d6dfa18f47 100644 --- a/install/tpl/system.ini.master +++ b/install/tpl/system.ini.master @@ -35,6 +35,7 @@ client_username_web_check_disabled=n backups_include_into_web_quota=n reseller_can_use_options=n web_php_options=no,fast-cgi,mod,php-fpm +show_aps_menu=n [tools] diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php index a9aefad967..775a704873 100644 --- a/interface/web/sites/lib/module.conf.php +++ b/interface/web/sites/lib/module.conf.php @@ -157,33 +157,37 @@ if($app->auth->get_client_limit($userid, 'shell_user') != 0 or $app->auth->get_c } // APS menu -if($app->auth->get_client_limit($userid, 'aps') != 0) -{ - $items = array(); - - $items[] = array( 'title' => 'Available packages', - 'target' => 'content', - 'link' => 'sites/aps_availablepackages_list.php', - 'html_id' => 'aps_availablepackages_list'); - - $items[] = array( 'title' => 'Installed packages', - 'target' => 'content', - 'link' => 'sites/aps_installedpackages_list.php', - 'html_id' => 'aps_installedpackages_list'); - - - // Second menu group, available only for admins - if($_SESSION['s']['user']['typ'] == 'admin') - { - $items[] = array( 'title' => 'Update Packagelist', - 'target' => 'content', - 'link' => 'sites/aps_update_packagelist.php', - 'html_id' => 'aps_packagedetails_show'); - } - - $module['nav'][] = array( 'title' => 'APS Installer', - 'open' => 1, - 'items' => $items); +if($app->auth->get_client_limit($userid, 'aps') != 0) { + // read web config + $app->uses('getconf'); + $global_config = $app->getconf->get_global_config('sites'); + if($global_config['show_aps_menu'] == 'y') { + $items = array(); + + $items[] = array( 'title' => 'Available packages', + 'target' => 'content', + 'link' => 'sites/aps_availablepackages_list.php', + 'html_id' => 'aps_availablepackages_list'); + + $items[] = array( 'title' => 'Installed packages', + 'target' => 'content', + 'link' => 'sites/aps_installedpackages_list.php', + 'html_id' => 'aps_installedpackages_list'); + + + // Second menu group, available only for admins + if($_SESSION['s']['user']['typ'] == 'admin') + { + $items[] = array( 'title' => 'Update Packagelist', + 'target' => 'content', + 'link' => 'sites/aps_update_packagelist.php', + 'html_id' => 'aps_packagedetails_show'); + } + + $module['nav'][] = array( 'title' => 'APS Installer', + 'open' => 1, + 'items' => $items); + } } // Statistics menu -- GitLab