diff options
author | James Atkinson <thefinn@users.sourceforge.net> | 2003-03-04 17:52:50 +0000 |
---|---|---|
committer | James Atkinson <thefinn@users.sourceforge.net> | 2003-03-04 17:52:50 +0000 |
commit | fd629c7a9ff83de74635b403de31c42c65860ab1 (patch) | |
tree | 734b05a784fcf87500fafb2f9d9a3b6a3eeca545 /phpBB/includes/functions.php | |
parent | c5b9e64505ee45e416a77bb988101c340be0dfa9 (diff) | |
download | forums-fd629c7a9ff83de74635b403de31c42c65860ab1.tar forums-fd629c7a9ff83de74635b403de31c42c65860ab1.tar.gz forums-fd629c7a9ff83de74635b403de31c42c65860ab1.tar.bz2 forums-fd629c7a9ff83de74635b403de31c42c65860ab1.tar.xz forums-fd629c7a9ff83de74635b403de31c42c65860ab1.zip |
Tons of work on the UCP, see my topic in the development forum for more info
on the bigger changes.
Registration should still work, the basic layout of the UCP is also done
with the start on the profile settings area.
git-svn-id: file:///svn/phpbb/trunk@3591 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index cb8da7e8c0..5123ab78c7 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -799,105 +799,6 @@ function redirect($url) exit; } -// Check to see if the username has been taken, or if it is disallowed. -// Also checks if it includes the " character, which we don't allow in usernames. -// Used for registering, changing names, and posting anonymously with a username -function validate_username($username) -{ - global $db, $user; - - $username = $db->sql_escape($username); - - $sql = "SELECT username - FROM " . USERS_TABLE . " - WHERE LOWER(username) = '" . strtolower($username) . "'"; - $result = $db->sql_query($sql); - - if (($row = $db->sql_fetchrow($result)) && $row['username'] != $user->data['username']) - { - return $user->lang['Username_taken']; - } - - $sql = "SELECT group_name - FROM " . GROUPS_TABLE . " - WHERE LOWER(group_name) = '" . strtolower($username) . "'"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - return $user->lang['Username_taken']; - } - - $sql = "SELECT disallow_username - FROM " . DISALLOW_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (preg_match('#\b(' . str_replace('\*', '.*?', preg_quote($row['disallow_username'], '#')) . ')\b#i', $username)) - { - return $user->lang['Username_disallowed']; - } - } - - $sql = "SELECT word - FROM " . WORDS_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (preg_match('#\b(' . str_replace('\*', '.*?', preg_quote($row['word'], '#')) . ')\b#i', $username)) - { - return $user->lang['Username_disallowed']; - } - } - - // Don't allow " in username. - if (strstr($username, '"')) - { - return $user->lang['Username_invalid']; - } - - return false; -} - -// Check to see if email address is banned or already present in the DB -function validate_email($email) -{ - global $db, $user; - - if ($email != '') - { - if (preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email)) - { - $sql = "SELECT ban_email - FROM " . BANLIST_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#is', $email)) - { - return $user->lang['Email_banned']; - } - } - - $sql = "SELECT user_email - FROM " . USERS_TABLE . " - WHERE user_email = '" . $db->sql_escape($email) . "'"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - return $user->lang['Email_taken']; - } - - return false; - } - } - - return $user->lang['Email_invalid']; -} // Does supplementary validation of optional profile fields. This // expects common stuff like trim() and strip_tags() to have already |