diff options
Diffstat (limited to 'modules/extra/m_sql_authentication.cpp')
-rw-r--r-- | modules/extra/m_sql_authentication.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index abdd745a5..ecc8700f6 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -1,5 +1,5 @@ #include "module.h" -#include "sql.h" +#include "modules/sql.h" static Module *me; @@ -41,14 +41,9 @@ class SQLAuthenticationResult : public SQL::Interface if (na == NULL) { na = new NickAlias(req->GetAccount(), new NickCore(req->GetAccount())); - if (user) - { - if (Config->NSAddAccessOnReg) - na->nc->AddAccess(user->Mask()); - - if (NickServ) - user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); - } + FOREACH_MOD(I_OnNickRegister, OnNickRegister(user, na)); + if (user && NickServ) + user->SendMessage(NickServ, _("Your account \002%s\002 has been successfully created."), na->nick.c_str()); } if (!email.empty() && email != na->nc->email) @@ -78,25 +73,20 @@ class ModuleSQLAuthentication : public Module ServiceReference<SQL::Provider> SQL; public: - ModuleSQLAuthentication(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, SUPPORTED) + ModuleSQLAuthentication(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR) { - this->SetAuthor("Anope"); - me = this; Implementation i[] = { I_OnReload, I_OnPreCommand, I_OnCheckAuthentication }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - this->OnReload(); } - void OnReload() anope_override + void OnReload(Configuration::Conf *conf) anope_override { - ConfigReader config; - - this->engine = config.ReadValue("m_sql_authentication", "engine", "", 0); - this->query = config.ReadValue("m_sql_authentication", "query", "", 0); - this->disable_reason = config.ReadValue("m_sql_authentication", "disable_reason", "", 0); + Configuration::Block *config = conf->GetModule(this); + this->engine = config->Get<const Anope::string>("engine"); + this->query = config->Get<const Anope::string>("query"); + this->disable_reason = config->Get<const Anope::string>("disable_reason"); this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } |