mirror of
https://github.com/anope/anope.git
synced 2026-07-07 22:23:14 +02:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user