diff --git a/modules/user.module b/modules/user.module index c7cf27f3f1e..be537f9b742 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 c7cf27f3f1e..be537f9b742 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)); }