From 95a6cd2a3b955300da0bfcfff6c5b0da091282b1 Mon Sep 17 00:00:00 2001 From: Jimmi08 Date: Wed, 30 Mar 2022 22:17:41 +0200 Subject: [PATCH] #4659 forum main admin as silent moderator - without displaying in moderator list (if they are not forum moderators directly) CLOSES #4659 --- e107_plugins/forum/forum_class.php | 2 +- e107_plugins/forum/forum_post.php | 2 +- e107_plugins/forum/forum_viewforum.php | 2 +- e107_plugins/forum/forum_viewtopic.php | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index d72939897..23ad5c8c7 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -535,7 +535,7 @@ class e107forum } // Check if user has moderator permissions for this thread - if(!in_array(USERID, $moderatorUserIds)) + if(!in_array(USERID, $moderatorUserIds) && !getperms('0')) { $ret['msg'] = ''.LAN_FORUM_8030.''; $ret['hide'] = false; diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 9dea4c3e9..822240fd2 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -80,7 +80,7 @@ class forum_post_handler $moderatorUserIds = $forum->getModeratorUserIdsByThreadId($this->id); } - define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds))); + define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds) || getperms('0'))); $this->data = $this->processGet(); diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index 45b37baf5..7700162e6 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -234,7 +234,7 @@ function init() } $moderatorUserIds = $forum->getModeratorUserIdsByForumId($forumId); - define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds))); + define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds) || getperms('0'))); if(MODERATOR) { diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index e2994d468..161a00544 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -86,8 +86,7 @@ $thread->init(); /* Check if use has moderator permissions for this thread */ $moderatorUserIds = $forum->getModeratorUserIdsByThreadId($thread->threadInfo['thread_id']); -define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds))); - +define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds) || getperms('0') )); if(e_AJAX_REQUEST) {