1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-31 02:00:14 +02:00

FIX check moderator permissions for thread-operations

Without admin permissions (member of user class 254) it was not possible to modify threads in
the forum. This fix get the forum-moderator permissions by the threadId to modify this thread.
This commit is contained in:
phibel
2018-10-03 17:42:14 +02:00
parent 37d086c418
commit c644a8b9d2
3 changed files with 63 additions and 21 deletions

View File

@@ -200,21 +200,15 @@ if(!empty($forumInfo['forum_description']))
), 250, '...'));
}
//define('MODERATOR', $forum_info['forum_moderators'] != '' && check_class($forum_info['forum_moderators']));
//$modArray = $forum->forum_getmods($forum_info['forum_moderators']);
$moderatorUserIds = $forum->getModeratorUserIdsByForumId($forumId);
define('MODERATOR', (USER && in_array(USERID, $moderatorUserIds)));
// $thread???
$modArray = $forum->forumGetMods($thread->forum_info['forum_moderators']);
define('MODERATOR', (USER && is_array($modArray) && in_array(USERID, array_keys($modArray))));
//----$message = '';
if (MODERATOR)
{
if ($_POST)
{
require_once(e_PLUGIN.'forum/forum_mod.php');
//-- $message = forum_thread_moderate($_POST);
$forumSCvars['message']=forum_thread_moderate($_POST);
$forumSCvars['message'] = forum_thread_moderate($_POST);
}
}