mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11492] Initialize $user_ids and $group_users arrays
Also avoid unneccessary calls to permissions when user_ids is empty PHPBB3-11492
This commit is contained in:
parent
4d4cf25edd
commit
1296417b52
1 changed files with 5 additions and 3 deletions
|
@ -146,7 +146,7 @@ switch ($mode)
|
||||||
|
|
||||||
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
|
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
|
||||||
|
|
||||||
$user_ary = array();
|
$user_ary = $user_ids = $group_users = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$row['forums'] = '';
|
$row['forums'] = '';
|
||||||
|
@ -157,11 +157,13 @@ switch ($mode)
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($config['teampage_forums'])
|
$user_ids = array_unique($user_ids);
|
||||||
|
|
||||||
|
if (!empty($user_ids) && $config['teampage_forums'])
|
||||||
{
|
{
|
||||||
$template->assign_var('S_DISPLAY_MODERATOR_FORUMS', true);
|
$template->assign_var('S_DISPLAY_MODERATOR_FORUMS', true);
|
||||||
// Get all moderators
|
// Get all moderators
|
||||||
$perm_ary = $auth->acl_get_list(array_unique($user_ids), array('m_'), false);
|
$perm_ary = $auth->acl_get_list($user_ids, array('m_'), false);
|
||||||
|
|
||||||
foreach ($perm_ary as $forum_id => $forum_ary)
|
foreach ($perm_ary as $forum_id => $forum_ary)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue