diff options
Diffstat (limited to 'modules/nickserv/cert.cpp')
-rw-r--r-- | modules/nickserv/cert.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/nickserv/cert.cpp b/modules/nickserv/cert.cpp index 3cf25732f..c7bd2a207 100644 --- a/modules/nickserv/cert.cpp +++ b/modules/nickserv/cert.cpp @@ -345,6 +345,13 @@ class NSCert : public Module if (!nc || nc->HasFieldS("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{0}\002 has already reached the maximum number of simultaneous logins ({1})."), nc->GetDisplay(), maxlogins); + return; + } + NickServ::Nick *na = NickServ::FindNick(u->nick); if (na && na->GetAccount() == nc) u->Identify(na); @@ -363,6 +370,14 @@ class NSCert : public Module if (cs.Matches(u, na->GetAccount())) { ServiceBot *NickServ = Config->GetClient("NickServ"); + + unsigned int maxlogins = Config->GetModule("ns_identify")->Get<unsigned int>("maxlogins"); + if (maxlogins && na->GetAccount()->users.size() >= maxlogins) + { + u->SendMessage(NickServ, _("Account \002{0}\002 has already reached the maximum number of simultaneous logins ({1})."), na->GetAccount()->GetDisplay(), 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->GetAccount()->GetDisplay() << " via SSL certificate fingerprint"; |