diff options
Diffstat (limited to 'modules/commands/ns_cert.cpp')
-rw-r--r-- | modules/commands/ns_cert.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index aedb816d2..87702b834 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -362,6 +362,13 @@ class NSCert : public Module if (!nc || nc->HasExt("NS_SUSPENDED")) return; + unsigned int maxlogins = Config->GetModule("ns_identify")->Get<unsigned int>("maxlogins"); + if (maxlogins && nc->users.size() >= maxlogins) + { + u->SendMessage(NickServ, _("Account \002%s\002 has already reached the maximum number of simultaneous logins (%u)."), nc->display.c_str(), maxlogins); + return; + } + NickAlias *na = NickAlias::Find(u->nick); if (na && na->nc == nc) u->Identify(na); @@ -378,7 +385,16 @@ class NSCert : public Module if (!u->fingerprint.empty() && cl && cl->FindCert(u->fingerprint)) { BotInfo *NickServ = Config->GetClient("NickServ"); + + unsigned int maxlogins = Config->GetModule("ns_identify")->Get<unsigned int>("maxlogins"); + if (maxlogins && na->nc->users.size() >= maxlogins) + { + u->SendMessage(NickServ, _("Account \002%s\002 has already reached the maximum number of simultaneous logins (%u)."), na->nc->display.c_str(), maxlogins); + return EVENT_CONTINUE; + } + u->Identify(na); + u->SendMessage(NickServ, _("SSL certificate fingerprint accepted, you are now identified.")); Log(NickServ) << u->GetMask() << " automatically identified for account " << na->nc->display << " via SSL certificate fingerprint"; return EVENT_ALLOW; |