On further checking the code used in forums.php to check AUTH levels is:
Code: Select all
//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
//
$sql = "SELECT aa.forum_id, u.user_id, u.username
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
WHERE aa.auth_mod = " . TRUE . "
AND g.group_single_user = 1
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
AND u.user_id = ug.user_id
GROUP BY u.user_id, u.username, aa.forum_id
ORDER BY aa.forum_id, u.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
$forum_moderators = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
}
$sql = "SELECT aa.forum_id, g.group_id, g.group_name
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE aa.auth_mod = " . TRUE . "
AND g.group_single_user = 0
AND g.group_type <> " . GROUP_HIDDEN . "
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
GROUP BY g.group_id, g.group_name, aa.forum_id
ORDER BY aa.forum_id, g.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
}
and that in digests:
Code: Select all
// Now we need to add to our forums array other forums that may be private for which
// the user has access.
$sql = 'SELECT DISTINCT a.forum_id, f.forum_name, c.cat_order, f.forum_order
FROM ' . AUTH_ACCESS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
WHERE ug.user_id = ' . $userdata['user_id']
. ' AND ug.user_pending = 0
AND a.group_id = ug.group_id AND
a.forum_id = f.forum_id AND f.cat_id = c.cat_id';
if ( !($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not query forum information', '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow ($result))
{
$forum_ids [$i] = $row['forum_id'];
$forum_names [$i] = $row['forum_name'];
$cat_orders [$i] = $row['cat_order'];
$forum_orders [$i] = $row['forum_order'];
$i++;
}
$i--;
The permissions on the forum are to allow designated MODs only access of which of course the test user isn't a MOD. I've verified the user can not acces the Admin forum from within the site. Does this help at all? I can of course provide an complete copy of forum.php if needed as quite a few MODs have been applied to the forum itself.