diff options
author | James Atkinson <thefinn@users.sourceforge.net> | 2002-02-03 19:19:42 +0000 |
---|---|---|
committer | James Atkinson <thefinn@users.sourceforge.net> | 2002-02-03 19:19:42 +0000 |
commit | 225a4ff8e77443aa358bec092532f37a381f622a (patch) | |
tree | c6a219bf1aa09fb27e57346e4c68f72e1f4d1452 /phpBB/includes/functions.php | |
parent | 721207ef48c5b81cfb06fcc10e03f5954890f971 (diff) | |
download | forums-225a4ff8e77443aa358bec092532f37a381f622a.tar forums-225a4ff8e77443aa358bec092532f37a381f622a.tar.gz forums-225a4ff8e77443aa358bec092532f37a381f622a.tar.bz2 forums-225a4ff8e77443aa358bec092532f37a381f622a.tar.xz forums-225a4ff8e77443aa358bec092532f37a381f622a.zip |
Fixed bug #507473
git-svn-id: file:///svn/phpbb/trunk@2049 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f9506dafd4..48cddc3ff1 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -497,7 +497,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add // function validate_username($username) { - global $db, $lang; + global $db, $lang, $userdata; $sql = "SELECT u.username, g.group_name FROM " . USERS_TABLE . " u, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug @@ -507,9 +507,23 @@ function validate_username($username) OR LOWER(g.group_name) = '" . strtolower(str_replace("\'", "''", $username)) . "' )"; if ( $result = $db->sql_query($sql) ) { - if ( $db->sql_fetchrow($result) ) + if ( $row = $db->sql_fetchrow($result) ) { - return array('error' => $lang['Username_taken']); + if($userdata['session_logged_in']) + { + if($row['username'] != $userdata['username']) + { + return array('error' => $lang['Username_taken']); + } + else + { + return array('error' => ''); + } + } + else + { + return array('error' => $lang['Username_taken']); + } } } |