mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-26 04:55:12 +02:00
display those as admins having admin permissions and being within the administrators group (admin group does not need to be the default one)
git-svn-id: file:///svn/phpbb/trunk@7201 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@ -67,8 +67,10 @@ switch ($mode)
|
|||||||
{
|
{
|
||||||
case 'leaders':
|
case 'leaders':
|
||||||
// Display a listing of board admins, moderators
|
// Display a listing of board admins, moderators
|
||||||
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
|
|
||||||
$user->add_lang('groups');
|
$user->add_lang('groups');
|
||||||
|
|
||||||
$page_title = $user->lang['THE_TEAM'];
|
$page_title = $user->lang['THE_TEAM'];
|
||||||
$template_html = 'memberlist_leaders.html';
|
$template_html = 'memberlist_leaders.html';
|
||||||
|
|
||||||
@ -120,6 +122,17 @@ switch ($mode)
|
|||||||
$admin_group_id = (int) $db->sql_fetchfield('group_id');
|
$admin_group_id = (int) $db->sql_fetchfield('group_id');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
// Get group memberships for the admin id ary...
|
||||||
|
$admin_memberships = group_memberships($admin_group_id, $admin_id_ary);
|
||||||
|
$admin_user_ids = array();
|
||||||
|
|
||||||
|
// ok, we only need the user ids...
|
||||||
|
foreach ($admin_memberships as $row)
|
||||||
|
{
|
||||||
|
$admin_user_ids[$row['user_id']] = true;
|
||||||
|
}
|
||||||
|
unset($admin_memberships);
|
||||||
|
|
||||||
$sql = 'SELECT forum_id, forum_name
|
$sql = 'SELECT forum_id, forum_name
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
WHERE forum_type = ' . FORUM_POST;
|
WHERE forum_type = ' . FORUM_POST;
|
||||||
@ -152,18 +165,15 @@ switch ($mode)
|
|||||||
|
|
||||||
'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
|
'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
|
||||||
));
|
));
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';
|
$which_row = (in_array($row['user_id'], $admin_id_ary)) ? 'admin' : 'mod';
|
||||||
|
|
||||||
// We sort out admins not having the admin group as default
|
// We sort out admins not within the 'Administrators' group.
|
||||||
// The drawback is that only those admins are displayed which are within
|
// Else, we will list those as admin only having the permission to view logs for example.
|
||||||
// the special group 'Administrators' and also having it assigned as their default group.
|
if ($which_row == 'admin' && empty($admin_user_ids[$row['user_id']]))
|
||||||
// - might change
|
|
||||||
if ($which_row == 'admin' && $row['default_group'] != $admin_group_id)
|
|
||||||
{
|
{
|
||||||
// Remove from admin_id_ary, because the user may be a mod instead
|
// Remove from admin_id_ary, because the user may be a mod instead
|
||||||
unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);
|
unset($admin_id_ary[array_search($row['user_id'], $admin_id_ary)]);
|
||||||
|
Reference in New Issue
Block a user