Skip to content

Commit bad49e1

Browse files
author
Till Brehm
committed
Merge branch 'hide-aps' into 'stable-3.1'
Hide APS menu See merge request ispconfig/ispconfig3!1078
2 parents cf865a9 + e39688e commit bad49e1

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

install/tpl/system.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ client_username_web_check_disabled=n
3535
backups_include_into_web_quota=n
3636
reseller_can_use_options=n
3737
web_php_options=no,fast-cgi,mod,php-fpm
38+
show_aps_menu=n
3839

3940

4041
[tools]

interface/web/sites/lib/module.conf.php

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -157,33 +157,37 @@
157157
}
158158

159159
// APS menu
160-
if($app->auth->get_client_limit($userid, 'aps') != 0)
161-
{
162-
$items = array();
163-
164-
$items[] = array( 'title' => 'Available packages',
165-
'target' => 'content',
166-
'link' => 'sites/aps_availablepackages_list.php',
167-
'html_id' => 'aps_availablepackages_list');
168-
169-
$items[] = array( 'title' => 'Installed packages',
170-
'target' => 'content',
171-
'link' => 'sites/aps_installedpackages_list.php',
172-
'html_id' => 'aps_installedpackages_list');
173-
174-
175-
// Second menu group, available only for admins
176-
if($_SESSION['s']['user']['typ'] == 'admin')
177-
{
178-
$items[] = array( 'title' => 'Update Packagelist',
179-
'target' => 'content',
180-
'link' => 'sites/aps_update_packagelist.php',
181-
'html_id' => 'aps_packagedetails_show');
182-
}
183-
184-
$module['nav'][] = array( 'title' => 'APS Installer',
185-
'open' => 1,
186-
'items' => $items);
160+
if($app->auth->get_client_limit($userid, 'aps') != 0) {
161+
// read web config
162+
$app->uses('getconf');
163+
$global_config = $app->getconf->get_global_config('sites');
164+
if($global_config['show_aps_menu'] == 'y') {
165+
$items = array();
166+
167+
$items[] = array( 'title' => 'Available packages',
168+
'target' => 'content',
169+
'link' => 'sites/aps_availablepackages_list.php',
170+
'html_id' => 'aps_availablepackages_list');
171+
172+
$items[] = array( 'title' => 'Installed packages',
173+
'target' => 'content',
174+
'link' => 'sites/aps_installedpackages_list.php',
175+
'html_id' => 'aps_installedpackages_list');
176+
177+
178+
// Second menu group, available only for admins
179+
if($_SESSION['s']['user']['typ'] == 'admin')
180+
{
181+
$items[] = array( 'title' => 'Update Packagelist',
182+
'target' => 'content',
183+
'link' => 'sites/aps_update_packagelist.php',
184+
'html_id' => 'aps_packagedetails_show');
185+
}
186+
187+
$module['nav'][] = array( 'title' => 'APS Installer',
188+
'open' => 1,
189+
'items' => $items);
190+
}
187191
}
188192

189193
// Statistics menu

0 commit comments

Comments
 (0)