Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] [MCP] - moderators cant mark reported posts in child forums [C-Chris]
#1
MyBB 1.4.2

User which is a moderator of a category cannot mark reported posts for his child forums. It is because of:
file: modcp.php
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{
	$query = $db->simple_select("moderators", "*", "uid='{$mybb->user['uid']}'");
and resulting variable $flist have only fids of categories, not all child forums. This variable $flist is used in update query:
$db->update_query("reportedposts", array('reportstatus' => 1), "rid IN ({$rids}){$flist}");



A possible fix:
FIND:
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{
	$query = $db->simple_select("moderators", "*", "uid='{$mybb->user['uid']}'");
	while($forum = $db->fetch_array($query))
	{
		$flist .= ",'{$forum['fid']}'";
		$moderated_forums[] = $forum['fid'];
	}
REPLACE WITH:
// SQL for fetching items only related to forums this user moderates
$moderated_forums = array();
if($mybb->usergroup['issupermod'] != 1)
{
	$mc_moderators_cache = $cache->read("moderators");
	foreach($mc_moderators_cache as $mc_fid => $mc_moderators)
	{
		if ($mc_fid and is_array($mc_moderators))
		{
			if (array_key_exists($mybb->user['uid'], $mc_moderators))
			{
				$flist .= ",'$mc_fid'";
				$moderated_forums[] = $mc_fid;
			}
		}
	}
www.kozik.net.pl
- So... Maybe you shouldn't have hacked it.
- And why don't you try not breathing. Hurts, dunnit. (userfriendly.org)
#2
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
#3
In modcp.php find:

$flist .= ",'{$forum['fid']}'";

add after

$children = get_child_list($forum['fid']);
if(!empty($children))
{
	$flist .= ",'".implode("','", $children)."'";
}


Forum Jump:


Users browsing this thread: 1 Guest(s)