1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 21:16:39 +02:00

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

This commit is contained in:
Adam
2012-10-07 22:39:58 -04:00
parent 0a111c1976
commit b8b63ff115
54 changed files with 687 additions and 470 deletions
+8 -10
View File
@@ -41,33 +41,31 @@ class ENone : public Module
return EVENT_ALLOW;
}
EventReturn OnCheckAuthentication(Command *c, CommandSource *source, const std::vector<Anope::string> &params, 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("plain"))
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;
}
};