summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorlethality <lethality@anope.org>2012-02-23 02:32:49 +0000
committerlethality <lethality@anope.org>2012-02-23 02:32:49 +0000
commitba32aad4cb61321e93c1ab5b94b0a67963c344cc (patch)
tree4c0f2a7cdaaf134aa0a1a46996b48d766b9a8465 /modules
parentf01aab5f9bf5c14162438d1707e6e6cd9730c703 (diff)
parent24811e59705f2d8995f900f82066084bf22f15ec (diff)
Merge branch '1.9' of ssh://anope.git.sf.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/ns_register.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp
index 0ebc5dadc..6050e88fb 100644
--- a/modules/commands/ns_register.cpp
+++ b/modules/commands/ns_register.cpp
@@ -121,6 +121,12 @@ class CommandNSRegister : public Command
return;
}
+ if (Config->NSRegistration.equals_ci("disable"))
+ {
+ source.Reply(_("Registration is currently disabled."));
+ return;
+ }
+
if (!u->HasMode(UMODE_OPER) && Config->NickRegDelay && Anope::CurTime - u->my_signon < Config->NickRegDelay)
{
source.Reply(_("You must have been using this nick for at least %d seconds to register."), Config->NickRegDelay);
@@ -190,7 +196,12 @@ class CommandNSRegister : public Command
if (enc_decrypt(na->nc->pass, tmp_pass) == 1)
source.Reply(_("Your password is \002%s\002 - remember this for later use."), tmp_pass.c_str());
- if (Config->NSEmailReg)
+ if (Config->NSRegistration.equals_ci("admin"))
+ {
+ na->nc->SetFlag(NI_UNCONFIRMED);
+ source.Reply(_("All new accounts must be validated by an administrator. Please wait for your registration to be confirmed."));
+ }
+ else if (Config->NSRegistration.equals_ci("mail"))
{
na->nc->SetFlag(NI_UNCONFIRMED);
if (SendRegmail(u, na, source.owner))
@@ -199,7 +210,7 @@ class CommandNSRegister : public Command
source.Reply(_("If you do not confirm your email address within %s your account will expire."), duration(Config->NSUnconfirmedExpire).c_str());
}
}
- else
+ else if (Config->NSRegistration.equals_ci("none"))
{
ircdproto->SendLogin(u);
if (!Config->NoNicknameOwnership && na->nc == u->Account() && na->nc->HasFlag(NI_UNCONFIRMED) == false)
@@ -261,7 +272,7 @@ class CommandNSResend : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
- if (!Config->NSEmailReg)
+ if (Config->NSRegistration.equals_ci("mail"))
return;
User *u = source.u;
@@ -290,7 +301,7 @@ class CommandNSResend : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
{
- if (!Config->NSEmailReg)
+ if (Config->NSRegistration.equals_ci("mail"))
return false;
this->SendSyntax(source);
@@ -302,7 +313,7 @@ class CommandNSResend : public Command
void OnServHelp(CommandSource &source) anope_override
{
- if (Config->NSEmailReg)
+ if (Config->NSRegistration.equals_ci("mail"))
Command::OnServHelp(source);
}
};
@@ -319,6 +330,8 @@ class NSRegister : public Module
{
this->SetAuthor("Anope");
+ if (Config->NSRegistration.equals_ci("disable"))
+ throw ModuleException("Module will not load with nickserv:registration disabled.");
}
};