2007-09-05, 05:47 PM
Well I thought this was fixed but apparently not. It could be that in an update this has broken. On Advanced Stats On Index plugin you can view a hidden forums thread in "newest threads". There is a parameter for $unviewableforums but apparently something isn't working correctly.
Anyone have an idea?
If you run this module you should check this feature as subjects in your admin/staff or other hidden areas will be viewable.
Here is the function not working...
Edit: I just noticed this function isn't even called in the page AT ALL. This is the beginning of the page though that does relate to the forum permissions. Something isn't working obviously.
Anyone have an idea?
If you run this module you should check this feature as subjects in your admin/staff or other hidden areas will be viewable.
Here is the function not working...
function asoi_get_unviewable_forums()
{
global $db, $forum_cache, $permissioncache, $mybb, $unviewableforums, $unviewable, $templates, $forumpass;
$pid = intval($pid);
if(!$permissions)
{
$permissions = $mybb->usergroup;
}
if(!is_array($forum_cache))
{
cache_forums();
}
if(!is_array($permissioncache))
{
$permissioncache = forum_permissions();
}
foreach($forum_cache as $fid => $forum)
{
if($permissioncache[$forum['fid']])
{
$perms = $permissioncache[$forum['fid']];
}
else
{
$perms = $mybb->usergroup;
}
$pwverified = 1;
if($forum['password'] != "")
{
if($_COOKIE['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))
{
$pwverified = 0;
}
}
if($perms['canview'] == "no" || $pwverified == 0)
{
if($unviewableforums)
{
$unviewableforums .= ",";
}
$unviewableforums .= "'".$forum['fid']."'";
}
}
return $unviewableforums;
}
Edit: I just noticed this function isn't even called in the page AT ALL. This is the beginning of the page though that does relate to the forum permissions. Something isn't working obviously.
//PLUGIN HOOK FUNCTIONS
function asoi($page)
{
global $db, $lang, $mybb, $cache, $theme, $forum_cache, $templates;
// Get forum permissions
if(!is_array($forum_cache))
{
cache_forums();
}
foreach($forum_cache as $fid => $forum)
{
$perms = forum_permissions($forum['fid']);
$pwverified = 1;
if($forum['password'] != "")
{
if($_COOKIE['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))
{
$pwverified = 0;
}
}
if($perms['canview'] == "no" || $pwverified == 0)
{
if($unviewableforums)
{
$unviewableforums .= ",";
}
$unviewableforums .= "'".$forum['fid']."'";
}
}
$fidnot = '1=1';
if($unviewableforums)
{
$fidnot = "fid NOT IN ($unviewableforums)";
}