2008-09-25, 09:21 AM
(This post was last modified: 2008-11-09, 09:59 PM by Chris W. B..)
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
A possible fix:
FIND:
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)
- So... Maybe you shouldn't have hacked it.
- And why don't you try not breathing. Hurts, dunnit. (userfriendly.org)