mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Ok that was stupid.. Better version of a fix for 497077... Somebody hand me a beer.
git-svn-id: file:///svn/phpbb/trunk@1784 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
a4934d0e25
commit
1c40ad5736
1 changed files with 1 additions and 25 deletions
|
@ -502,6 +502,7 @@ function validate_username($username)
|
|||
switch(SQL_LAYER)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$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
|
||||
|
@ -526,31 +527,6 @@ function validate_username($username)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 'mysql4':
|
||||
$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(str_replace("\'", "''", $username)) . "'
|
||||
OR LOWER(g.group_name) = '" . strtolower(str_replace("\'", "''", $username)) . "' )";
|
||||
$sql_disallow = "SELECT disallow_username
|
||||
FROM " . DISALLOW_TABLE . "
|
||||
WHERE '" . str_replace("\'", "''", $username) . "' LIKE disallow_username";
|
||||
if($result = $db->sql_query($sql_users))
|
||||
{
|
||||
if($db->sql_numrows($result) > 0)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
if($result = $db->sql_query($sql_disallow))
|
||||
{
|
||||
if($db->sql_numrows($result) > 0)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql = "SELECT u.username, g.group_name
|
||||
|
|
Loading…
Add table
Reference in a new issue