diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-20 15:50:33 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-03-04 12:08:28 +0000 |
commit | 9649dc78a1de477eae07084a737fd54841671867 (patch) | |
tree | 73699a8bf00ff36eaeab710299c4314d7deebf47 | |
parent | ee7455daa8d80aff7ce41842e218d73a114f7bf2 (diff) |
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.
-rw-r--r-- | modules/extra/m_ldap_authentication.cpp | 9 | ||||
-rw-r--r-- | modules/extra/m_sql_authentication.cpp | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 981efca52..5340038dd 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -299,6 +299,15 @@ class ModuleLDAPAuthentication : public Module Anope::string new_dn = username_attribute + "=" + na->nick + "," + basedn; this->ldap->Add(&this->orinterface, new_dn, attributes); } + + 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(ModuleLDAPAuthentication) 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) |