From f7c8791a6d918bfc5ff920c3d97c289f4317760a Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 23 Jan 2022 13:43:33 +0000 Subject: make sure we have an existing default role in any case --- Zotlabs/Module/Admin/Site.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Admin/Site.php') 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'); -- cgit v1.2.3