From 801583fd072e8ebe06fa6aeb97d9dd78785a6f39 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 18 Dec 2020 12:40:36 +0000 Subject: flag forums where we do not have post permissions and filter them from the acl selector --- include/acl_selectors.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/acl_selectors.php') diff --git a/include/acl_selectors.php b/include/acl_selectors.php index a3476439a..8da46649c 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -82,7 +82,6 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti $r = q("SELECT id, hash, gname FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) ); - if($r) { $groups .= ''; foreach($r as $rr) { @@ -110,13 +109,23 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti if($dialog_description) { $forums = get_forum_channels(local_channel(),1); if($forums) { - $groups .= ''; + $forums_count = 0; + $forum_otions = ''; foreach($forums as $f) { + if($f['no_post_perms']) + continue; + $private = (($f['private_forum']) ? ' (' . t('Private Forum') . ')' : ''); $selected = (($single_group && $f['hash'] === $allow_cid[0]) ? ' selected = "selected" ' : ''); - $groups .= '' . "\r\n"; + $forum_otions .= '' . "\r\n"; + $forums_count++; } - $groups .= ''; + if($forums_count) { + $groups .= ''; + $groups .= $forum_otions; + $groups .= ''; + } + } } -- cgit v1.2.3