1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

FIX allow moderators to edit posts from other users

This commit is contained in:
phibel
2018-10-03 15:56:37 +02:00
parent c644a8b9d2
commit f480064ba4
2 changed files with 7 additions and 2 deletions

View File

@@ -66,8 +66,9 @@ class forum_post_handler
$this->id = (int) $_GET['id']; // forum thread/topic id.
$this->post = (int) $_GET['post']; // post ID if needed.
define('MODERATOR', USER && $this->forumObj->isModerator(USERID));
$moderatorUserIds = $forum->getModeratorUserIdsByPostId($this->post);
define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds)));
$this->data = $this->processGet();

View File

@@ -142,8 +142,12 @@ if (USER && (USERID != $thread->threadInfo['thread_user'] || $thread->threadInfo
}
define('e_PAGETITLE', strip_tags($tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off')).' / '.$tp->toHTML($thread->threadInfo['forum_name'], true, 'no_hook, emotes_off').' / '.LAN_FORUM_1001);
$forum->modArray = $forum->forumGetMods($thread->threadInfo['forum_moderators']);
define('MODERATOR', (USER && $forum->isModerator(USERID)));
/* Check if use has moderator permissions for this thread */
$moderatorUserIds = $forum->getModeratorUserIdsByThreadId($thread->threadInfo['thread_id']);
define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds)));
e107::getScBatch('view', 'forum')->setScVar('forum', $forum);
//var_dump(e107::getScBatch('forum', 'forum'));