diff options
author | Adam <Adam@anope.org> | 2015-03-12 08:00:12 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-03-12 08:00:12 -0400 |
commit | c5ff7c686837afbb854aa6546ade3aa8c86a1cd1 (patch) | |
tree | 34b29642844886068f3379ff999b1067b6a96750 /modules/commands/ns_set.cpp | |
parent | 92920f5a1c8866c8e26e1608f0feb3e3e54c8dd2 (diff) |
Show passlen in PASSWORD_TOO_LONG
Diffstat (limited to 'modules/commands/ns_set.cpp')
-rw-r--r-- | modules/commands/ns_set.cpp | 15 |
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; } |