Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Sources/Subs-Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,10 @@ function rebuildModCache()
global $user_info, $smcFunc;

// What groups can they moderate?
$group_query = allowedTo('manage_membergroups') ? '1=1' : '0=1';
if (!$user_info['is_guest'])
$group_query = allowedTo('manage_membergroups') ? '1=1' : '0=1';
else
$group_query = '0=1';

if ($group_query == '0=1' && !$user_info['is_guest'])
{
Expand All @@ -779,7 +782,10 @@ function rebuildModCache()
}

// Then, same again, just the boards this time!
$board_query = allowedTo('moderate_forum') ? '1=1' : '0=1';
if (!$user_info['is_guest'])
$board_query = allowedTo('moderate_forum') ? '1=1' : '0=1';
else
$board_query = '0=1';

if ($board_query == '0=1' && !$user_info['is_guest'])
{
Expand Down Expand Up @@ -833,7 +839,7 @@ function rebuildModCache()
// If you change the format of 'gq' and/or 'bq' make sure to adjust 'can_mod' in Load.php.
'gq' => $group_query,
'bq' => $board_query,
'ap' => boardsAllowedTo('approve_posts'),
'ap' => !$user_info['is_guest'] ? boardsAllowedTo('approve_posts') : array(),
'mb' => $boards_mod,
'mq' => $mod_query,
);
Expand Down
Loading