aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorthe_systech <the_systech@users.sourceforge.net>2002-01-03 15:09:22 +0000
committerthe_systech <the_systech@users.sourceforge.net>2002-01-03 15:09:22 +0000
commita4934d0e25187257340a4946b6f545b3c54e254f (patch)
treead97483547dd94f4f2d26539ef4c20329a2a361e /phpBB/includes/functions.php
parent9cba658cef8f437b35e6ee3093fa9cdb3f6f93fa (diff)
downloadforums-a4934d0e25187257340a4946b6f545b3c54e254f.tar
forums-a4934d0e25187257340a4946b6f545b3c54e254f.tar.gz
forums-a4934d0e25187257340a4946b6f545b3c54e254f.tar.bz2
forums-a4934d0e25187257340a4946b6f545b3c54e254f.tar.xz
forums-a4934d0e25187257340a4946b6f545b3c54e254f.zip
Updated validate_username function for use with mysql4 Bug #497077
git-svn-id: file:///svn/phpbb/trunk@1783 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index eb8b6cd15e..cd6bf26fca 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -526,6 +526,31 @@ 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