diff options
author | Adam <Adam@anope.org> | 2011-04-28 22:44:34 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:09:32 -0400 |
commit | 583954d3a1db658281a9afb7b7dd6773726c8c11 (patch) | |
tree | 6a00865d5738c6d0bc42efb35f3f468c5876eb3e /modules/core/enc_sha256.cpp | |
parent | 8fb1604f649bec6f356770daf5df6bb8ab811bbf (diff) |
Use module type to determine what type each module is instead of its location in the configuration file.
Diffstat (limited to 'modules/core/enc_sha256.cpp')
-rw-r--r-- | modules/core/enc_sha256.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/modules/core/enc_sha256.cpp b/modules/core/enc_sha256.cpp index 06154ada0..a04510a33 100644 --- a/modules/core/enc_sha256.cpp +++ b/modules/core/enc_sha256.cpp @@ -247,13 +247,12 @@ class ESHA256 : public Module /********** ANOPE ******/ public: - ESHA256(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) + ESHA256(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, ENCRYPTION) { this->SetAuthor("Anope"); - this->SetType(ENCRYPTION); - Implementation i[] = { I_OnEncrypt, I_OnDecrypt, I_OnCheckAuthentication }; - ModuleManager::Attach(i, this, 3); + Implementation i[] = { I_OnEncrypt, I_OnCheckAuthentication }; + ModuleManager::Attach(i, this, 2); use_iv = false; } @@ -279,13 +278,6 @@ class ESHA256 : public Module return EVENT_ALLOW; } - EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) - { - if (!hashm.equals_cs("sha256")) - return EVENT_CONTINUE; - return EVENT_STOP; - } - EventReturn OnCheckAuthentication(User *u, Command *c, const std::vector<Anope::string> ¶ms, const Anope::string &account, const Anope::string &password) { NickAlias *na = findnick(account); @@ -310,7 +302,7 @@ class ESHA256 : public Module /* if we are NOT the first module in the list, * we want to re-encrypt the pass with the new encryption */ - if (!this->name.equals_ci(Config->EncModuleList.front())) + if (ModuleManager::FindFirstOf(ENCRYPTION) != this) enc_encrypt(password, nc->pass); return EVENT_ALLOW; } |