diff options
Diffstat (limited to 'modules/commands/ns_resetpass.cpp')
-rw-r--r-- | modules/commands/ns_resetpass.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/commands/ns_resetpass.cpp b/modules/commands/ns_resetpass.cpp index 39eead56e..e57261a9f 100644 --- a/modules/commands/ns_resetpass.cpp +++ b/modules/commands/ns_resetpass.cpp @@ -1,6 +1,6 @@ /* NickServ core functions * - * (C) 2003-2012 Anope Team + * (C) 2003-2013 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. @@ -20,16 +20,16 @@ class CommandNSResetPass : public Command public: CommandNSResetPass(Module *creator) : Command(creator, "nickserv/resetpass", 1, 1) { - this->SetFlag(CFLAG_ALLOW_UNREGISTERED); this->SetDesc(_("Helps you reset lost passwords")); this->SetSyntax(_("\037nickname\037")); + this->AllowUnregistered(true); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { const NickAlias *na; - if (Config->RestrictMail && source.HasCommand("nickserv/resetpass")) + if (Config->RestrictMail && !source.HasCommand("nickserv/resetpass")) source.Reply(ACCESS_DENIED); else if (!(na = NickAlias::Find(params[0]))) source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str()); @@ -49,7 +49,7 @@ class CommandNSResetPass : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Sends a code key to the nickname with instructions on how to\n" + source.Reply(_("Sends a passcode to the nickname with instructions on how to\n" "reset their password.")); return true; } @@ -78,6 +78,12 @@ class NSResetPass : public Module ModuleManager::Attach(I_OnPreCommand, this); } + ~NSResetPass() + { + for (nickcore_map::const_iterator it = NickCoreList->begin(), it_end = NickCoreList->end(); it != it_end; ++it) + it->second->Shrink("ns_resetpass"); + } + EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override { if (command->name == "nickserv/confirm" && params.size() > 1) @@ -98,9 +104,9 @@ class NSResetPass : public Module { nc->Shrink("ns_resetpass"); - Log(LOG_COMMAND, source, &commandnsresetpass) << "confirmed RESETPASS to forcefully identify to " << na->nick; + Log(LOG_COMMAND, source, &commandnsresetpass) << "confirmed RESETPASS to forcefully identify as " << na->nick; - nc->UnsetFlag(NI_UNCONFIRMED); + nc->Shrink("UNCONFIRMED"); if (source.GetUser()) { |