From 9649dc78a1de477eae07084a737fd54841671867 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 20 Feb 2024 15:50:33 +0000 Subject: When using ldap/sql auth prevent displays expiring before their group. This prevents zombie accounts from being left around that can't be authenticated to. Closes #355. --- modules/extra/m_sql_authentication.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/extra/m_sql_authentication.cpp') diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index c292aef99..623381cf1 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -143,6 +143,15 @@ class ModuleSQLAuthentication : public Module Log(LOG_DEBUG) << "m_sql_authentication: Checking authentication for " << req->GetAccount(); } + + void OnPreNickExpire(NickAlias *na, bool &expire) anope_override + { + // We can't let nicks expire if they still have a group or + // there will be a zombie account left over that can't be + // authenticated to. + if (na->nick == na->nc->display && na->nc->aliases->size() > 1) + expire = false; + } }; MODULE_INIT(ModuleSQLAuthentication) -- cgit