mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 08:25:42 +02:00
Merge pull request #5601 from senky/ticket/16013
[ticket/16013] Allow admins to use disallowed username
This commit is contained in:
commit
65ff149fc9
@ -855,7 +855,7 @@ class acp_users
|
|||||||
$check_ary += array(
|
$check_ary += array(
|
||||||
'username' => array(
|
'username' => array(
|
||||||
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
|
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
|
||||||
array('username', $user_row['username'])
|
array('username', $user_row['username'], true)
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1732,7 +1732,7 @@ function phpbb_validate_timezone($timezone)
|
|||||||
* @return mixed Either false if validation succeeded or a string which will be
|
* @return mixed Either false if validation succeeded or a string which will be
|
||||||
* used as the error message (with the variable name appended)
|
* 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;
|
||||||
|
|
||||||
@ -1815,6 +1815,8 @@ function validate_username($username, $allowed_username = false)
|
|||||||
return 'USERNAME_TAKEN';
|
return 'USERNAME_TAKEN';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$allow_all_names)
|
||||||
|
{
|
||||||
$bad_usernames = $cache->obtain_disallowed_usernames();
|
$bad_usernames = $cache->obtain_disallowed_usernames();
|
||||||
|
|
||||||
foreach ($bad_usernames as $bad_username)
|
foreach ($bad_usernames as $bad_username)
|
||||||
@ -1824,6 +1826,7 @@ function validate_username($username, $allowed_username = false)
|
|||||||
return 'USERNAME_DISALLOWED';
|
return 'USERNAME_DISALLOWED';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user