diff options
-rw-r--r-- | data/modules.example.conf | 6 | ||||
-rw-r--r-- | modules/extra/m_sql_authentication.cpp | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/data/modules.example.conf b/data/modules.example.conf index a6c226750..8e41aa734 100644 --- a/data/modules.example.conf +++ b/data/modules.example.conf @@ -466,6 +466,12 @@ module { name = "help" } * If not set, then registration is not blocked. */ #disable_reason = "To register on this network visit http://some.misconfigured.site/register" + + /* + * If set, the reason to give the users who try to "/msg NickServ SET EMAIL". + * If not set, then email changing is not blocked. + */ + #disable_email_reason = "To change your email address visit http://some.misconfigured.site" } /* diff --git a/modules/extra/m_sql_authentication.cpp b/modules/extra/m_sql_authentication.cpp index 823090884..2342ef89d 100644 --- a/modules/extra/m_sql_authentication.cpp +++ b/modules/extra/m_sql_authentication.cpp @@ -69,7 +69,7 @@ class ModuleSQLAuthentication : public Module { Anope::string engine; Anope::string query; - Anope::string disable_reason; + Anope::string disable_reason, disable_email_reason; ServiceReference<SQL::Provider> SQL; @@ -86,6 +86,7 @@ class ModuleSQLAuthentication : public Module 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->disable_email_reason = config->Get<Anope::string>("disable_email_reason"); this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine); } @@ -98,6 +99,12 @@ class ModuleSQLAuthentication : public Module return EVENT_STOP; } + if (!this->disable_email_reason.empty() && command->name == "nickserv/set/email") + { + source.Reply(this->disable_email_reason); + return EVENT_STOP; + } + return EVENT_CONTINUE; } |