Changeset

12907:d2333b468d07

mod_c2s: Disconnect accounts when they are disabled We decided that at the first stage, accounts that are disabled should simply be prevented from authenticating, thus they should also be prevented from having connected sessions. Since this is aimed to be a moderation action for cases of abuse, they shouldn't be allowed to continue being connected.
author Kim Alvefur <zash@zash.se>
date Thu, 23 Feb 2023 16:28:57 +0100
parents 12906:e282c92ded0e
children 12908:e96c3ea64996
files plugins/mod_c2s.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Thu Feb 23 16:25:31 2023 +0100
+++ b/plugins/mod_c2s.lua	Thu Feb 23 16:28:57 2023 +0100
@@ -266,6 +266,7 @@
 module:hook_global("user-password-changed", disconnect_user_sessions({ condition = "reset", text = "Password changed" }, true), 200);
 module:hook_global("user-role-changed", disconnect_user_sessions({ condition = "reset", text = "Role changed" }), 200);
 module:hook_global("user-deleted", disconnect_user_sessions({ condition = "not-authorized", text = "Account deleted" }), 200);
+module:hook_global("user-disabled", disconnect_user_sessions({ condition = "not-authorized", text = "Account disabled" }), 200);
 
 module:hook_global("c2s-session-updated", function (event)
 	sessions[event.session.conn] = event.session;