summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-01-04 13:44:47 -0500
committerAdam <Adam@anope.org>2014-01-04 13:44:47 -0500
commitd64855b35b27cc474ce03bcc5809fcf0cd8e11cf (patch)
tree60e54cdaeccb81e90203d8a0d1298fe666c95bdf
parent4617fdbf3de54b076f0b3765dad5798cf65ed741 (diff)
Allow m_sql_authentication to disable email changing similar to m_ldap_authentication
-rw-r--r--data/modules.example.conf6
-rw-r--r--modules/extra/m_sql_authentication.cpp9
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;
}