mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
An improved version of the username patch I committed the other day
+ remove sessions and auto-login keys when deleting a user Developers - please test this for any unusual code paths to make sure I have not missed any git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5359 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -177,6 +177,20 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username'])
|
||||
message_die(GENERAL_ERROR, 'Could not delete user from banlist table', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM " . SESSIONS_TABLE . "
|
||||
WHERE session_user_id = $user_id";
|
||||
if ( !$db->sql_query($sql) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not delete sessions for this user', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM " . SESSIONS_KEYS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
if ( !$db->sql_query($sql) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not delete auto-login keys for this user', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$sql = "SELECT privmsgs_id
|
||||
FROM " . PRIVMSGS_TABLE . "
|
||||
WHERE privmsgs_from_userid = $user_id
|
||||
@@ -217,7 +231,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username'])
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
|
||||
$username = ( !empty($HTTP_POST_VARS['username']) ) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['username']))) : '';
|
||||
$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
|
||||
$email = ( !empty($HTTP_POST_VARS['email']) ) ? trim(strip_tags(htmlspecialchars( $HTTP_POST_VARS['email'] ) )) : '';
|
||||
|
||||
$password = ( !empty($HTTP_POST_VARS['password']) ) ? trim(strip_tags(htmlspecialchars( $HTTP_POST_VARS['password'] ) )) : '';
|
||||
|
Reference in New Issue
Block a user