summaryrefslogtreecommitdiff
path: root/modules/commands/ns_set.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_set.cpp
parent92920f5a1c8866c8e26e1608f0feb3e3e54c8dd2 (diff)
Show passlen in PASSWORD_TOO_LONG
Diffstat (limited to 'modules/commands/ns_set.cpp')
-rw-r--r--modules/commands/ns_set.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index fdf2a5e38..e8e7c335c 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -133,9 +133,11 @@ class CommandNSSetPassword : public Command
source.Reply(MORE_OBSCURE_PASSWORD);
return;
}
- else if (len > Config->GetModule("nickserv")->Get<unsigned>("passlen", "32"))
+
+ unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
+ if (len > passlen)
{
- source.Reply(PASSWORD_TOO_LONG);
+ source.Reply(PASSWORD_TOO_LONG, passlen);
return;
}
@@ -191,14 +193,17 @@ class CommandNSSASetPassword : public Command
source.Reply(_("You may not change the password of other Services Operators."));
return;
}
- else if (nc->display.equals_ci(params[1]) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && len < 5))
+
+ if (nc->display.equals_ci(params[1]) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && len < 5))
{
source.Reply(MORE_OBSCURE_PASSWORD);
return;
}
- else if (len > Config->GetModule("nickserv")->Get<unsigned>("passlen", "32"))
+
+ unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
+ if (len > passlen)
{
- source.Reply(PASSWORD_TOO_LONG);
+ source.Reply(PASSWORD_TOO_LONG, passlen);
return;
}