From 995702f5c636308d0f5171b184c0511b7d297187 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Mon, 14 Jan 2019 12:38:01 +0100 Subject: [PATCH 1/3] issue #3619: Missing moderator ids on forum move In case the post id is not set use the thread id to look for the moderator ids --- e107_plugins/forum/forum_post.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 8fc08480d..febf3e563 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -67,7 +67,17 @@ class forum_post_handler $this->post = (int) $_GET['post']; // post ID if needed. - $moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->post); + // issue #3619: In case the post id is not set + // use the thread id to look for the moderator ids + if (isset($this->post)) + { + $moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->post); + } + else + { + $moderatorUserIds = $forum->getModeratorUserIdsByThreadId($this->id); + } + define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds))); @@ -802,8 +812,17 @@ class forum_post_handler */ private function renderFormMove() { + if (isset($_POST['forum_move'])) + { + // Forum just moved. No need to display the forum move form again. + return; + } + if(!deftrue('MODERATOR')) { + // todo: LAN for new error message + $mes = e107::getMessage(); + echo $mes->addWarning('You do not have access to this area!')->render(); return; } From ce4c96d193abf054245024c7b25829e690feb754 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Wed, 16 Jan 2019 11:44:11 +0100 Subject: [PATCH 2/3] issue #3619: check $this->post for being empty instead of being set --- e107_plugins/forum/forum_post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index febf3e563..42c579983 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -69,7 +69,7 @@ class forum_post_handler // issue #3619: In case the post id is not set // use the thread id to look for the moderator ids - if (isset($this->post)) + if (!empty($this->post)) { $moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->post); } From ae822adfcc90554e214bb63dc9923d3b3a81bfb7 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Wed, 16 Jan 2019 19:09:53 +0100 Subject: [PATCH 3/3] issue #3619: switched error message to LAN_NO_PERMISSIONS --- e107_plugins/forum/forum_post.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 42c579983..2c7bb6293 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -820,9 +820,8 @@ class forum_post_handler if(!deftrue('MODERATOR')) { - // todo: LAN for new error message $mes = e107::getMessage(); - echo $mes->addWarning('You do not have access to this area!')->render(); + echo $mes->addWarning(LAN_NO_PERMISSIONS)->render(); return; }