diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-07-22 20:32:05 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-07-22 20:32:05 +0000 |
commit | d145bca394b999b6309aeea48785baa41e30a4f7 (patch) | |
tree | 56ab81d697c24cfcc541fc2de197cebaed73eb02 /phpBB/includes/functions.php | |
parent | 287feac024fbe6e19f1580ef5429614f36da0a88 (diff) | |
download | forums-d145bca394b999b6309aeea48785baa41e30a4f7.tar forums-d145bca394b999b6309aeea48785baa41e30a4f7.tar.gz forums-d145bca394b999b6309aeea48785baa41e30a4f7.tar.bz2 forums-d145bca394b999b6309aeea48785baa41e30a4f7.tar.xz forums-d145bca394b999b6309aeea48785baa41e30a4f7.zip |
Still seems to be pagination problem, I dont have it so what havent I committed ...
git-svn-id: file:///svn/phpbb/trunk@728 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ac4aed3dd9..98769d178b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -471,9 +471,12 @@ function validate_username($username) // a UNION clause which would be very nice here :( // So we have to use two queries case 'mysql': - $sql_users = "SELECT username - FROM " . USERS_TABLE . " - WHERE LOWER(username) = '" . strtolower($username) . "'"; + $sql_users = "SELECT u.username, g.group_name + FROM " . USERS_TABLE . " u, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug + WHERE ug.user_id = u.user_id + AND g.group_id = ug.group_id + AND ( LOWER(u.username) = '" . strtolower($username) . "' + OR LOWER(g.group_name) = '" . strtolower($username) . "' )"; $sql_disallow = "SELECT disallow_username FROM " . DISALLOW_TABLE . " WHERE disallow_username = '$username'"; @@ -494,13 +497,16 @@ function validate_username($username) break; default: - $sql = "SELECT disallow_username - FROM " . DISALLOW_TABLE . " - WHERE disallow_username = '$username' - UNION - SELECT username - FROM " . USERS_TABLE . " - WHERE LOWER(username) = '" . strtolower($username) . "'"; + $sql = "SELECT u.username, g.group_name + FROM " . USERS_TABLE . " u, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug + WHERE ug.user_id = u.user_id + AND g.group_id = ug.group_id + AND ( LOWER(u.username) = '" . strtolower($username) . "' + OR LOWER(g.group_name) = '" . strtolower($username) . "' ) + UNION + SELECT disallow_username, NULL + FROM " . DISALLOW_TABLE . " + WHERE disallow_username = '$username'"; if($result = $db->sql_query($sql)) { if($db->sql_numrows($result) > 0) |