summaryrefslogtreecommitdiff
path: root/modules/commands/ns_register.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-03-12 08:00:12 -0400
committerAdam <Adam@anope.org>2015-03-12 08:00:12 -0400
commitc5ff7c686837afbb854aa6546ade3aa8c86a1cd1 (patch)
tree34b29642844886068f3379ff999b1067b6a96750 /modules/commands/ns_register.cpp
parent92920f5a1c8866c8e26e1608f0feb3e3e54c8dd2 (diff)
Show passlen in PASSWORD_TOO_LONG
Diffstat (limited to 'modules/commands/ns_register.cpp')
-rw-r--r--modules/commands/ns_register.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp
index 4793b2269..75ef5a9fb 100644
--- a/modules/commands/ns_register.cpp
+++ b/modules/commands/ns_register.cpp
@@ -170,6 +170,8 @@ class CommandNSRegister : public Command
}
}
+ unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
+
if (Config->GetModule("nickserv")->Get<bool>("forceemail", "yes") && email.empty())
this->OnSyntaxError(source, "");
else if (u && Anope::CurTime < u->lastnickreg + reg_delay)
@@ -178,8 +180,8 @@ class CommandNSRegister : public Command
source.Reply(NICK_ALREADY_REGISTERED, u_nick.c_str());
else if (pass.equals_ci(u_nick) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && pass.length() < 5))
source.Reply(MORE_OBSCURE_PASSWORD);
- else if (pass.length() > Config->GetModule("nickserv")->Get<unsigned>("passlen", "32"))
- source.Reply(PASSWORD_TOO_LONG);
+ else if (pass.length() > passlen)
+ source.Reply(PASSWORD_TOO_LONG, passlen);
else if (!email.empty() && !Mail::Validate(email))
source.Reply(MAIL_X_INVALID, email.c_str());
else