Don't show the local community page on single user instances
This commit is contained in:
parent
5142528913
commit
5290b1404b
1 changed files with 8 additions and 3 deletions
|
@ -26,10 +26,15 @@ function community_content(App $a, $update = 0)
|
||||||
|
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
$content = $a->argv[1];
|
$content = $a->argv[1];
|
||||||
|
} else {
|
||||||
|
if (!empty(Config::get('system','singleuser'))) {
|
||||||
|
// On single user systems only the global page does make sense
|
||||||
|
$content = 'global';
|
||||||
} else {
|
} else {
|
||||||
// When only the global community is allowed, we use this as default
|
// When only the global community is allowed, we use this as default
|
||||||
$content = $page_style == CP_GLOBAL_COMMUNITY ? 'global' : 'local';
|
$content = $page_style == CP_GLOBAL_COMMUNITY ? 'global' : 'local';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!in_array($content, ['local', 'global'])) {
|
if (!in_array($content, ['local', 'global'])) {
|
||||||
notice(t('Community option not available.') . EOL);
|
notice(t('Community option not available.') . EOL);
|
||||||
|
@ -61,7 +66,7 @@ function community_content(App $a, $update = 0)
|
||||||
if (!$update) {
|
if (!$update) {
|
||||||
$tabs = [];
|
$tabs = [];
|
||||||
|
|
||||||
if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) {
|
if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system','singleuser'))) {
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
'label' => t('Community'),
|
'label' => t('Community'),
|
||||||
'url' => 'community/local',
|
'url' => 'community/local',
|
||||||
|
|
Loading…
Reference in a new issue