aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/groupcp.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-02-13 00:37:27 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-02-13 00:37:27 +0000
commitd0207fee9b33895a62f8f1cb7cff2c0cb90e52df (patch)
tree95ae37569d85aff85f7486f9ac9e28be86970a08 /phpBB/groupcp.php
parentdbbc372ca7e6c3223c47c39bcb3584cd5f5c043a (diff)
downloadforums-d0207fee9b33895a62f8f1cb7cff2c0cb90e52df.tar
forums-d0207fee9b33895a62f8f1cb7cff2c0cb90e52df.tar.gz
forums-d0207fee9b33895a62f8f1cb7cff2c0cb90e52df.tar.bz2
forums-d0207fee9b33895a62f8f1cb7cff2c0cb90e52df.tar.xz
forums-d0207fee9b33895a62f8f1cb7cff2c0cb90e52df.zip
Fix problem where groups for which user is member appear in the Join Group dropbox
git-svn-id: file:///svn/phpbb/trunk@2122 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/groupcp.php')
-rw-r--r--phpBB/groupcp.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php
index b50155c9d7..a4d2c43304 100644
--- a/phpBB/groupcp.php
+++ b/phpBB/groupcp.php
@@ -1100,6 +1100,7 @@ else
message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
}
+ $in_group = array();
$s_member_groups_opt = "";
$s_pending_groups_opt = "";
while( $row = $db->sql_fetchrow($result) )
@@ -1112,15 +1113,15 @@ else
{
$s_member_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
}
+ $in_group[] = $row['group_id'];
}
$s_pending_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_pending_groups_opt . "</select>";
$s_member_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_member_groups_opt . "</select>";
- $sql = "SELECT DISTINCT g.group_id, g.group_name
- FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
- WHERE ug.user_id <> " . $userdata['user_id'] . "
- AND ug.group_id = g.group_id
- AND g.group_single_user <> " . TRUE . "
+ $sql = "SELECT group_id, group_name
+ FROM " . GROUPS_TABLE . " g
+ WHERE group_single_user <> " . TRUE . "
+ AND group_id NOT IN (" . implode(", ", $in_group) . ")
ORDER BY g.group_name";
if ( !($result = $db->sql_query($sql)) )
{