git-svn-id: file:///svn/phpbb/trunk@6806 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-12-24 15:35:24 +00:00
parent cbd1fb07ed
commit fb4e1920fc
6 changed files with 18 additions and 3 deletions

View file

@ -790,7 +790,7 @@ class acp_users
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS');
$pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL');
if ($user_id == $user->data['user_id'])

View file

@ -1148,7 +1148,7 @@ function validate_username($username)
return false;
}
if (!preg_match('#^' . str_replace('\\\\', '\\', $config['allow_name_chars']) . '$#i', $username) || strpos($username, '"') !== false || strpos($username, '"') !== false)
if (!preg_match('#^' . str_replace('\\\\', '\\', $config['allow_name_chars']) . '$#ui', $username) || strpos($username, '"') !== false || strpos($username, '"') !== false)
{
return 'INVALID_CHARS';
}

View file

@ -478,7 +478,7 @@ class ucp_register
break;
}
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS');
$pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL');
//

View file

@ -569,6 +569,17 @@ if (version_compare($current_version, '3.0.b4', '<='))
set_config('newest_user_colour', $row['user_colour'], true);
switch ($config['allow_name_chars'])
{
case '[\w]+':
set_config('allow_name_chars', '[a-z]+');
break;
case '[\w_\+\. \-\[\]]+':
set_config('allow_name_chars', '[-\]_+ [a-z]+');
break;
}
$no_updates = false;
}

View file

@ -204,6 +204,8 @@ $lang = array_merge($lang, array(
'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at the confirmation code before being locked out that session.',
'USERNAME_ALPHA_ONLY' => 'Alphanumeric only',
'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers',
'USERNAME_LETTER_NUM' => 'Any letter and number',
'USERNAME_LETTER_NUM_SPACERS' => 'Any letter, number, and spacer',
'USERNAME_CHARS' => 'Limit username chars',
'USERNAME_CHARS_ANY' => 'Any character',
'USERNAME_CHARS_EXPLAIN' => 'Restrict type of characters that may be used in usernames, spacers are; space, -, +, _, [ and ]',

View file

@ -453,6 +453,8 @@ $lang = array_merge($lang, array(
'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image, it will be copied to this site.',
'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only alphanumeric characters',
'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use alphanumeric, space or -+_[] characters.',
'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only letter or number characters',
'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use letter, number, space or -+_[] characters.',
'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$d and %2$d characters.',
'USERNAME_TAKEN_USERNAME' => 'The username you entered is already in use, please select an alternative.',
'USERNAME_DISALLOWED_USERNAME' => 'The username you entered has been banned.',