diff options
Diffstat (limited to 'modules/commands/ns_identify.cpp')
-rw-r--r-- | modules/commands/ns_identify.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp index ce564321c..4aa361a0a 100644 --- a/modules/commands/ns_identify.cpp +++ b/modules/commands/ns_identify.cpp @@ -77,16 +77,27 @@ class CommandNSIdentify : public Command NickAlias *na = NickAlias::Find(nick); if (na && na->nc->HasExt("NS_SUSPENDED")) + { source.Reply(NICK_X_SUSPENDED, na->nick.c_str()); - else if (u->Account() && na && u->Account() == na->nc) + return; + } + + if (u->Account() && na && u->Account() == na->nc) + { source.Reply(_("You are already identified.")); - else + return; + } + + unsigned int maxlogins = Config->GetModule(this->owner)->Get<unsigned int>("maxlogins"); + if (na && maxlogins && na->nc->users.size() >= maxlogins) { - NSIdentifyRequest *req = new NSIdentifyRequest(owner, source, this, na ? na->nc->display : nick, pass); - FOREACH_MOD(OnCheckAuthentication, (u, req)); - req->Dispatch(); + source.Reply(_("Account \2%s\2 has exceeeded the maximum number of simultaneous logins (%u)."), na->nc->display.c_str(), maxlogins); + return; } - return; + + NSIdentifyRequest *req = new NSIdentifyRequest(owner, source, this, na ? na->nc->display : nick, pass); + FOREACH_MOD(OnCheckAuthentication, (u, req)); + req->Dispatch(); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override |