- Delete a user's sessions when blocking his/her account.

4.6.x
Steven Wittens 2005-02-28 18:13:12 +00:00
parent ff386b90bb
commit 9803bc4321
2 changed files with 10 additions and 0 deletions

View File

@ -137,6 +137,11 @@ function user_save($account, $array = array(), $category = 'account') {
}
}
// Delete a blocked user's sessions to kick them if they are online.
if ($user->status == 0) {
db_query('DELETE FROM {sessions} WHERE uid = %d', $user->uid);
}
// Refresh user object
$user = user_load(array('uid' => $account->uid));
}

View File

@ -137,6 +137,11 @@ function user_save($account, $array = array(), $category = 'account') {
}
}
// Delete a blocked user's sessions to kick them if they are online.
if ($user->status == 0) {
db_query('DELETE FROM {sessions} WHERE uid = %d', $user->uid);
}
// Refresh user object
$user = user_load(array('uid' => $account->uid));
}