Current time: 05-24-2012, 03:48 PM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] [MCP] - moderators cant mark reported posts in child forums [C-Chris]
09-25-2008, 09:21 AM (This post was last modified: 11-09-2008 09:59 PM by Chris W. B..)
Post: #1
[F] [MCP] - moderators cant mark reported posts in child forums [C-Chris]
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
PHP Code:
// 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:
PHP Code:
$db->update_query("reportedposts", array('reportstatus' => 1), "rid IN ({$rids}){$flist}"); 



A possible fix:
FIND:
PHP Code:
// 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:
PHP Code:
// 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)
Visit this user's website Find all posts by this user
11-02-2008, 07:47 PM
Post: #2
[F] [MCP] - moderators cant mark reported posts in child forums
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
Visit this user's website Find all posts by this user
11-02-2008, 07:48 PM
Post: #3
RE: [F] [MCP] - moderators cant mark reported posts in child forums
In modcp.php find:

PHP Code:
$flist .= ",'{$forum['fid']}'"

add after

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

Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication