diff options
author | Adam <Adam@anope.org> | 2013-11-30 02:16:24 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-11-30 02:18:20 -0500 |
commit | 6628e714c7dfae824449eb60a8c6cfc501135e6b (patch) | |
tree | 28ae8745a3671dfcdc26b76817c5879cc893a76e /modules/commands/ns_resetpass.cpp | |
parent | 0f9e931fa6641bc8a28c1a3a26116534e568e3f1 (diff) |
Require email address to be passed to resetpass
Diffstat (limited to 'modules/commands/ns_resetpass.cpp')
-rw-r--r-- | modules/commands/ns_resetpass.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index fd0d582fb..7f9c6ac45 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -16,10 +16,10 @@ static bool SendResetEmail(User *u, const NickAlias *na, BotInfo *bi); class CommandNSResetPass : public Command { public: - CommandNSResetPass(Module *creator) : Command(creator, "nickserv/resetpass", 1, 1) + CommandNSResetPass(Module *creator) : Command(creator, "nickserv/resetpass", 2, 2) { this->SetDesc(_("Helps you reset lost passwords")); - this->SetSyntax(_("\037nickname\037")); + this->SetSyntax(_("\037nickname\037 \037email\037")); this->AllowUnregistered(true); } @@ -31,6 +31,8 @@ class CommandNSResetPass : public Command source.Reply(ACCESS_DENIED); else if (!(na = NickAlias::Find(params[0]))) source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str()); + else if (!na->nc->email.equals_ci(params[1])) + source.Reply(_("Incorrect email address.")); else { if (SendResetEmail(source.GetUser(), na, source.service)) @@ -48,7 +50,8 @@ class CommandNSResetPass : public Command this->SendSyntax(source); source.Reply(" "); source.Reply(_("Sends a passcode to the nickname with instructions on how to\n" - "reset their password.")); + "reset their password. Email must be the email address associated\n" + "to the nickname.")); return true; } }; |