-
Improvement
-
Resolution: Invalid
-
Minor
-
3.0.11
-
None
Hi,
Wouldn't it be better to prevent the admin or the moderator when this one wants to ban an user, who already is ?
I have made that small code to check the user id before the confirm action :
#
|
#-----[ OPEN ]------------------------------------------------
|
#
|
includes/mcp/mcp_ban.php
|
#
|
#-----[ FIND ]------------------------------------------------
|
#
|
if (confirm_box(true))
|
#
|
#-----[ BEFORE, ADD ]-----------------------------------------
|
#
|
if ( $mode === 'user' )
|
{
|
$sql = 'SELECT user_id
|
FROM ' . USERS_TABLE . "
|
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($ban)) . "'";
|
$result = $db->sql_query($sql);
|
$user_id = (int) $db->sql_fetchfield('user_id');
|
$db->sql_freeresult($result);
|
|
if ( !empty($user_id) )
|
{
|
trigger_error($user->lang['BAN_ALREADY_ENTERED'] . '<br /><br /><a href="' . $this->u_action . '">« ' . $user->lang['BACK_TO_PREV'] . '</a>');
|
}
|
}
|
#
|
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
|
#
|
# EoM
|