summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/user.module5
-rw-r--r--modules/user/user.module5
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/user.module b/modules/user.module
index c7cf27f3f..be537f9b7 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -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));
}
diff --git a/modules/user/user.module b/modules/user/user.module
index c7cf27f3f..be537f9b7 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -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));
}