From 59b27564488edc899ec8b73c8af9f47b94ede46b Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 12 Jun 2001 16:37:52 +0000 Subject: Switched validate_username check to groups table git-svn-id: file:///svn/phpbb/trunk@481 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bfff4b7461..72d48c1bf0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -427,11 +427,11 @@ 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 group_name AS username + FROM " . GROUPS_TABLE . " + WHERE LOWER(group_name) = '" . strtolower($username) . "'"; $sql_disallow = "SELECT disallow_username - FROM ".DISALLOW_TABLE." + FROM " . DISALLOW_TABLE . " WHERE disallow_username = '$username'"; if($result = $db->sql_query($sql_users)) @@ -452,12 +452,12 @@ function validate_username($username) default: $sql = "SELECT disallow_username - FROM ".DISALLOW_TABLE." + FROM " . DISALLOW_TABLE . " WHERE disallow_username = '$username' UNION - SELECT username - FROM ".USERS_TABLE." - WHERE LOWER(username) = '".strtolower($username)."'"; + SELECT group_name AS username + FROM " . GROUPS_TABLE . " + WHERE LOWER(group_name) = '" . strtolower($username) . "'"; if($result = $db->sql_query($sql)) { -- cgit v1.2.1