summaryrefslogtreecommitdiff
path: root/include/modules/nickserv/sasl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/modules/nickserv/sasl.h')
-rw-r--r--include/modules/nickserv/sasl.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/include/modules/nickserv/sasl.h b/include/modules/nickserv/sasl.h
index f23a5d32a..057c92c2a 100644
--- a/include/modules/nickserv/sasl.h
+++ b/include/modules/nickserv/sasl.h
@@ -85,77 +85,6 @@ namespace SASL
}
};
- class IdentifyRequest
- : public ::IdentifyRequest
- {
- Anope::string uid;
- Anope::string hostname;
-
- inline Anope::string GetUserInfo()
- {
- auto *u = User::Find(uid);
- if (u)
- return u->GetMask();
- if (!hostname.empty() && !GetAddress().empty())
- return Anope::printf("%s (%s)", hostname.c_str(), GetAddress().c_str());
- return "A user";
- };
-
- public:
- IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass, const Anope::string &h, const Anope::string &i)
- : ::IdentifyRequest(m, acc, pass, i)
- , uid(id)
- , hostname(h)
- {
- }
-
- void OnSuccess() override
- {
- if (!service)
- return;
-
- NickAlias *na = NickAlias::Find(GetAccount());
- if (!na || na->nc->HasExt("NS_SUSPENDED") || na->nc->HasExt("UNCONFIRMED"))
- return OnFail();
-
- unsigned int maxlogins = Config->GetModule("ns_identify").Get<unsigned int>("maxlogins");
- if (maxlogins && na->nc->users.size() >= maxlogins)
- return OnFail();
-
- Session *s = service->GetSession(uid);
- if (s)
- {
- Log(this->GetOwner(), "sasl", Config->GetClient("NickServ")) << GetUserInfo() << " identified to account " << this->GetAccount() << " using SASL";
- service->Succeed(s, na->nc);
- delete s;
- }
- }
-
- void OnFail() override
- {
- if (!service)
- return;
-
- Session *s = service->GetSession(uid);
- if (s)
- {
- service->Fail(s);
- delete s;
- }
-
- Anope::string accountstatus;
- NickAlias *na = NickAlias::Find(GetAccount());
- if (!na)
- accountstatus = "nonexistent ";
- else if (na->nc->HasExt("NS_SUSPENDED"))
- accountstatus = "suspended ";
- else if (na->nc->HasExt("UNCONFIRMED"))
- accountstatus = "unconfirmed ";
-
- Log(this->GetOwner(), "sasl", Config->GetClient("NickServ")) << GetUserInfo() << " failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL";
- }
- };
-
/** Sends IRCd messages used by the SASL module. */
class ProtocolInterface
: public ::Service