aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-03-28 17:52:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-03-28 17:52:03 +0000
commit1aed382e524261cf86f078d1e2814dc9cb7b1994 (patch)
treedd127fd87107fbdafaad00db7bb7e2443cba8414 /phpBB/includes
parent59921266fbb847389506acc98a2d95a420c6fc11 (diff)
downloadforums-1aed382e524261cf86f078d1e2814dc9cb7b1994.tar
forums-1aed382e524261cf86f078d1e2814dc9cb7b1994.tar.gz
forums-1aed382e524261cf86f078d1e2814dc9cb7b1994.tar.bz2
forums-1aed382e524261cf86f078d1e2814dc9cb7b1994.tar.xz
forums-1aed382e524261cf86f078d1e2814dc9cb7b1994.zip
fix additional group related thingy (correctly display memberships)
git-svn-id: file:///svn/phpbb/trunk@5748 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_users.php9
-rw-r--r--phpBB/includes/acp/auth.php20
2 files changed, 19 insertions, 10 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 393d58666d..edd6f294b4 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1626,7 +1626,7 @@ class acp_users
case 'groups':
- $user->add_lang('groups');
+ $user->add_lang(array('groups', 'acp/groups'));
$group_id = request_var('g', 0);
switch ($action)
@@ -1716,13 +1716,18 @@ class acp_users
// Select box for other groups
$sql = 'SELECT group_id, group_name, group_type
FROM ' . GROUPS_TABLE . '
- WHERE group_id NOT IN (' . implode(', ', $id_ary) . ')
+ ' . ((sizeof($id_ary)) ? 'WHERE group_id NOT IN (' . implode(', ', $id_ary) . ')' : '') . '
ORDER BY group_type DESC, group_name ASC';
$result = $db->sql_query($sql);
$s_group_options = '';
while ($row = $db->sql_fetchrow($result))
{
+ if ($config['coppa_hide_groups'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
+ {
+ continue;
+ }
+
$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index c1e1c4cc5e..ebbb129994 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -348,16 +348,20 @@ class auth_admin extends auth
$db->sql_freeresult($result);
$memberships = group_memberships(false, array_keys($hold_ary), false);
-
- foreach ($memberships as $row)
+
+ // User is not a member of any group? Bad admin, bad bad admin...
+ if ($memberships)
{
- if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
- {
- $user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
- }
- else
+ foreach ($memberships as $row)
{
- $user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
+ if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
+ {
+ $user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
+ }
+ else
+ {
+ $user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
+ }
}
}
unset($memberships, $groups);