aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-01-23 13:43:33 +0000
committerMario <mario@mariovavti.com>2022-01-23 13:43:33 +0000
commitf7c8791a6d918bfc5ff920c3d97c289f4317760a (patch)
tree79ace838856cbfec94f8c141ec1fd53056c07e3d /Zotlabs
parent7acc775c91a7aa80c08099a62d8d8c809adb7c0b (diff)
downloadvolse-hubzilla-f7c8791a6d918bfc5ff920c3d97c289f4317760a.tar.gz
volse-hubzilla-f7c8791a6d918bfc5ff920c3d97c289f4317760a.tar.bz2
volse-hubzilla-f7c8791a6d918bfc5ff920c3d97c289f4317760a.zip
make sure we have an existing default role in any case
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Admin/Site.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 00095187d..f6e3ab12b 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -340,10 +340,13 @@ class Site {
$discover_tab = (1 - $discover_tab);
$perm_roles = \Zotlabs\Access\PermissionRoles::channel_roles();
- $default_role = get_config('system','default_permissions_role','personal');
+ $default_role = get_config('system', 'default_permissions_role', 'personal');
- $role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles);
+ if (!in_array($default_role, array_keys($perm_roles))) {
+ $default_role = 'personal';
+ }
+ $role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles);
$homelogin = get_config('system','login_on_homepage');
$enable_context_help = get_config('system','enable_context_help');