diff options
author | Adam <Adam@anope.org> | 2010-08-28 13:58:23 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-08-28 13:58:23 -0400 |
commit | 26ba944d55fb4ee92dd5d7a3d2cfa869a8be151f (patch) | |
tree | 492e45839e4dbde571e18a0d85f30a35239a39ef | |
parent | 4cc660432675bdbb67018aa27f3b1ea896918dce (diff) |
Allow unidentified users to use sendpass and resetpasss if configured properly
-rw-r--r-- | modules/core/ns_resetpass.cpp | 3 | ||||
-rw-r--r-- | modules/core/ns_sendpass.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/core/ns_resetpass.cpp b/modules/core/ns_resetpass.cpp index 05c0b5e6b..ccb597862 100644 --- a/modules/core/ns_resetpass.cpp +++ b/modules/core/ns_resetpass.cpp @@ -20,13 +20,14 @@ class CommandNSResetPass : public Command public: CommandNSResetPass() : Command("RESETPASS", 1, 1) { + this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) { NickAlias *na; - if (Config->RestrictMail && !u->Account()->HasCommand("nickserv/resetpass")) + if (Config->RestrictMail && (!u->Account() || !u->Account()->HasCommand("nickserv/resetpass"))) notice_lang(Config->s_NickServ, u, ACCESS_DENIED); if (!(na = findnick(params[0]))) notice_lang(Config->s_NickServ, u, NICK_X_NOT_REGISTERED, params[0].c_str()); diff --git a/modules/core/ns_sendpass.cpp b/modules/core/ns_sendpass.cpp index f437e4a9e..6d0efb2a7 100644 --- a/modules/core/ns_sendpass.cpp +++ b/modules/core/ns_sendpass.cpp @@ -20,6 +20,7 @@ class CommandNSSendPass : public Command public: CommandNSSendPass() : Command("SENDPASS", 1, 1) { + this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) @@ -27,7 +28,7 @@ class CommandNSSendPass : public Command Anope::string nick = params[0]; NickAlias *na; - if (Config->RestrictMail && !u->Account()->HasCommand("nickserv/sendpass")) + if (Config->RestrictMail && (!u->Account() || !u->Account()->HasCommand("nickserv/sendpass"))) notice_lang(Config->s_NickServ, u, ACCESS_DENIED); else if (!(na = findnick(nick))) notice_lang(Config->s_NickServ, u, NICK_X_NOT_REGISTERED, nick.c_str()); |