mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 04:48:53 +00:00
do not validate username when disallowing it. ;) - #1220
git-svn-id: file:///svn/phpbb/trunk@5694 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
95e7b12706
commit
b206d63c51
2 changed files with 11 additions and 9 deletions
|
@ -34,16 +34,17 @@ class acp_disallow
|
||||||
if ($disallow)
|
if ($disallow)
|
||||||
{
|
{
|
||||||
$disallowed_user = str_replace('*', '%', request_var('disallowed_user', ''));
|
$disallowed_user = str_replace('*', '%', request_var('disallowed_user', ''));
|
||||||
$message = validate_username($disallowed_user);
|
|
||||||
|
|
||||||
if (!$message)
|
if (!$disallowed_user)
|
||||||
{
|
{
|
||||||
|
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action));
|
||||||
|
}
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
|
$sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$message = $user->lang['DISALLOW_SUCCESSFUL'];
|
$message = $user->lang['DISALLOW_SUCCESSFUL'];
|
||||||
add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
|
add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
|
||||||
}
|
|
||||||
|
|
||||||
trigger_error($message . adm_back_link($this->u_action));
|
trigger_error($message . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
@ -53,7 +54,7 @@ class acp_disallow
|
||||||
|
|
||||||
if (!$disallowed_id)
|
if (!$disallowed_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'DELETE FROM ' . DISALLOW_TABLE . "
|
$sql = 'DELETE FROM ' . DISALLOW_TABLE . "
|
||||||
|
|
|
@ -198,6 +198,7 @@ $lang = array_merge($lang, array(
|
||||||
'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added',
|
'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added',
|
||||||
|
|
||||||
'NO_DISALLOWED' => 'No Disallowed Usernames',
|
'NO_DISALLOWED' => 'No Disallowed Usernames',
|
||||||
|
'NO_USERNAME_SPECIFIED' => 'You haven\'t selected or entered a username to operate with.',
|
||||||
));
|
));
|
||||||
|
|
||||||
// Reasons
|
// Reasons
|
||||||
|
|
Loading…
Add table
Reference in a new issue