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

Allow m_sql_authentication to disable email changing similar to m_ldap_authentication

This commit is contained in:
Adam
2014-01-04 13:44:47 -05:00
parent 4617fdbf3d
commit d64855b35b
2 changed files with 14 additions and 1 deletions
+8 -1
View File
@@ -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;
}