Commit 9803bc43 authored by Steven Wittens's avatar Steven Wittens
Browse files

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

parent ff386b90
...@@ -137,6 +137,11 @@ function user_save($account, $array = array(), $category = 'account') { ...@@ -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 // Refresh user object
$user = user_load(array('uid' => $account->uid)); $user = user_load(array('uid' => $account->uid));
} }
......
...@@ -137,6 +137,11 @@ function user_save($account, $array = array(), $category = 'account') { ...@@ -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 // Refresh user object
$user = user_load(array('uid' => $account->uid)); $user = user_load(array('uid' => $account->uid));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment