From b1cf5d4e441c6e86525dd0c955bd617e7e492309 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Dec 2021 12:58:33 +0000 Subject: nag channel owners to select achannel role if they have not yet done so yet --- Zotlabs/Module/Settings/Channel.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Module/Settings/Channel.php') diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index 914523960..214dd505e 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -99,6 +99,11 @@ class Channel { date_default_timezone_set($timezone); } + if (!$role) { + notice(t('Please select a channel role') . EOL); + return; + } + if ($role !== get_pconfig(local_channel(), 'system', 'permissions_role')) { $role_permissions = PermissionRoles::role_perms($_POST['permissions_role']); @@ -200,12 +205,13 @@ class Channel { if ($vnotify === false) $vnotify = (-1); + $perm_roles = PermissionRoles::channel_roles(); $permissions_role = get_pconfig(local_channel(), 'system', 'permissions_role'); - if (!$permissions_role) { - $permissions_role = 'custom'; - } - $perm_roles = PermissionRoles::channel_roles(); + if (!in_array($permissions_role, ['public', 'personal', 'group', 'custom'])) { + notice(t('Please select a channel role') . EOL); + array_unshift($perm_roles , ''); + } $plugin = ['basic' => '', 'notify' => '']; call_hooks('channel_settings', $plugin); -- cgit v1.2.3