summaryrefslogtreecommitdiff
path: root/modules/commands/ns_identify.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-19 16:03:53 -0500
committerAdam <Adam@anope.org>2012-12-19 16:03:53 -0500
commit276247b463ab0731c1476c94adc247a2934960b3 (patch)
tree8d9b99f32e58e0e580dbcbd0ab4e36867df4dfa8 /modules/commands/ns_identify.cpp
parent67bd2c6b2da0d66dc7874dabbc8c9d2136efeb94 (diff)
Add a command flag to require that a user is executing the command
Diffstat (limited to 'modules/commands/ns_identify.cpp')
-rw-r--r--modules/commands/ns_identify.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp
index f1e0a7d3d..315e474f5 100644
--- a/modules/commands/ns_identify.cpp
+++ b/modules/commands/ns_identify.cpp
@@ -65,6 +65,7 @@ class CommandNSIdentify : public Command
CommandNSIdentify(Module *creator) : Command(creator, "nickserv/identify", 1, 2)
{
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
+ this->SetFlag(CFLAG_REQUIRE_USER);
this->SetDesc(_("Identify yourself with your password"));
this->SetSyntax(_("[\037account\037] \037password\037"));
}
@@ -73,9 +74,6 @@ class CommandNSIdentify : public Command
{
User *u = source.GetUser();
- if (!u)
- return;
-
const Anope::string &nick = params.size() == 2 ? params[0] : u->nick;
Anope::string pass = params[params.size() - 1];
@@ -87,7 +85,7 @@ class CommandNSIdentify : public Command
else
{
NSIdentifyRequest *req = new NSIdentifyRequest(owner, source, this, na ? na->nc->display : nick, pass);
- FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(source.GetUser(), req));
+ FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(u, req));
req->Dispatch();
}
return;