phpBB

Code Changes

File: includes/functions_user.php

  Unmodified   Added   Modified   Removed
Line 1732Line 1732
 * @return mixed							Either false if validation succeeded or a string which will be
* used as the error message (with the variable name appended)
*/

 * @return mixed							Either false if validation succeeded or a string which will be
* used as the error message (with the variable name appended)
*/

function validate_username($username, $allowed_username = false)

function validate_username($username, $allowed_username = false, $allow_all_names = false)

{
global $config, $db, $user, $cache;


{
global $config, $db, $user, $cache;


Line 1815Line 1815
		return 'USERNAME_TAKEN';
}


		return 'USERNAME_TAKEN';
}


 
	if (!$allow_all_names)
{

	$bad_usernames = $cache->obtain_disallowed_usernames();

foreach ($bad_usernames as $bad_username)

	$bad_usernames = $cache->obtain_disallowed_usernames();

foreach ($bad_usernames as $bad_username)

Line 1822Line 1824
		if (preg_match('#^' . $bad_username . '$#', $clean_username))
{
return 'USERNAME_DISALLOWED';

		if (preg_match('#^' . $bad_username . '$#', $clean_username))
{
return 'USERNAME_DISALLOWED';

 
			}

		}
}


		}
}


Line 1942Line 1945
		return $validate_email;
}


		return $validate_email;
}


	if (($ban = $user->check_ban(false, false, $email, true)) !== false)


	$ban = $user->check_ban(false, false, $email, true);
if (!empty($ban))

	{

	{

		return ($ban === true) ? 'EMAIL_BANNED' : (!empty($ban['ban_give_reason']) ? $ban['ban_give_reason'] : $ban);

		return !empty($ban['ban_give_reason']) ? $ban['ban_give_reason'] : 'EMAIL_BANNED';

	}

if (!$config['allow_emailreuse'])

	}

if (!$config['allow_emailreuse'])