From c5ff7c686837afbb854aa6546ade3aa8c86a1cd1 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 12 Mar 2015 08:00:12 -0400 Subject: Show passlen in PASSWORD_TOO_LONG --- modules/commands/ns_set.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'modules/commands/ns_set.cpp') 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("passlen", "32")) + + unsigned int passlen = Config->GetModule("nickserv")->Get("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("strictpasswords") && len < 5)) + + if (nc->display.equals_ci(params[1]) || (Config->GetBlock("options")->Get("strictpasswords") && len < 5)) { source.Reply(MORE_OBSCURE_PASSWORD); return; } - else if (len > Config->GetModule("nickserv")->Get("passlen", "32")) + + unsigned int passlen = Config->GetModule("nickserv")->Get("passlen", "32"); + if (len > passlen) { - source.Reply(PASSWORD_TOO_LONG); + source.Reply(PASSWORD_TOO_LONG, passlen); return; } -- cgit