diff options
Diffstat (limited to 'modules/commands/ns_resetpass.cpp')
-rw-r--r-- | modules/commands/ns_resetpass.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index 848fcc337..d89d16f3d 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -25,19 +25,24 @@ class CommandNSResetPass : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { - const NickServ::Nick *na; + const NickServ::Nick *na = NickServ::FindNick(params[0]); - if (!(na = NickServ::FindNick(params[0]))) + if (!na) + { source.Reply(_("\002{0}\002 isn't registered."), params[0]); - else if (!na->nc->email.equals_ci(params[1])) + return; + } + + if (!na->nc->email.equals_ci(params[1])) + { source.Reply(_("Incorrect email address.")); - else + return; + } + + if (SendResetEmail(source.GetUser(), na, source.service)) { - if (SendResetEmail(source.GetUser(), na, source.service)) - { - Log(LOG_COMMAND, source, this) << "for " << na->nick << " (group: " << na->nc->display << ")"; - source.Reply(_("Password reset email for \002{0}\002 has been sent."), na->nick); - } + Log(LOG_COMMAND, source, this) << "for " << na->nick << " (group: " << na->nc->display << ")"; + source.Reply(_("Password reset email for \002{0}\002 has been sent."), na->nick); } } |