diff options
author | Adam <Adam@anope.org> | 2012-10-07 22:39:58 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-07 22:39:58 -0400 |
commit | b8b63ff115f0daddf479b0da507a2f731255a06d (patch) | |
tree | d6b82bf0dfc39fdfe6a6a23ba318bb0c2906d6c1 /modules/encryption/enc_md5.cpp | |
parent | 0a111c19764ed14ab5f724c78d9dd8c08a3c124f (diff) |
Remove the asynchronous identifing hack and replace it with something better. Fixes m_*_authentication only being able to properly work when people identify normally using nickserv/identify
Diffstat (limited to 'modules/encryption/enc_md5.cpp')
-rw-r--r-- | modules/encryption/enc_md5.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/encryption/enc_md5.cpp b/modules/encryption/enc_md5.cpp index 73bc29557..bcbe4aeed 100644 --- a/modules/encryption/enc_md5.cpp +++ b/modules/encryption/enc_md5.cpp @@ -339,33 +339,31 @@ class EMD5 : public Module return EVENT_ALLOW; } - EventReturn OnCheckAuthentication(Command *c, CommandSource *source, const std::vector<Anope::string> ¶ms, const Anope::string &account, const Anope::string &password) anope_override + void OnCheckAuthentication(User *, IdentifyRequest *req) anope_override { - const NickAlias *na = findnick(account); + const NickAlias *na = findnick(req->GetAccount()); if (na == NULL) - return EVENT_CONTINUE; + return; NickCore *nc = na->nc; size_t pos = nc->pass.find(':'); if (pos == Anope::string::npos) - return EVENT_CONTINUE; + return; Anope::string hash_method(nc->pass.begin(), nc->pass.begin() + pos); if (!hash_method.equals_cs("md5")) - return EVENT_CONTINUE; + return; Anope::string buf; - this->OnEncrypt(password, buf); + this->OnEncrypt(req->GetPassword(), buf); if (nc->pass.equals_cs(buf)) { /* if we are NOT the first module in the list, * we want to re-encrypt the pass with the new encryption */ if (ModuleManager::FindFirstOf(ENCRYPTION) != this) - enc_encrypt(password, nc->pass); - return EVENT_ALLOW; + enc_encrypt(req->GetPassword(), nc->pass); + req->Success(this); } - - return EVENT_CONTINUE; } }; |