diff options
author | Adam <Adam@anope.org> | 2012-12-19 16:03:53 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-19 16:03:53 -0500 |
commit | 276247b463ab0731c1476c94adc247a2934960b3 (patch) | |
tree | 8d9b99f32e58e0e580dbcbd0ab4e36867df4dfa8 /modules/commands/os_login.cpp | |
parent | 67bd2c6b2da0d66dc7874dabbc8c9d2136efeb94 (diff) |
Add a command flag to require that a user is executing the command
Diffstat (limited to 'modules/commands/os_login.cpp')
-rw-r--r-- | modules/commands/os_login.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 735562819..ad0430f74 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -19,6 +19,7 @@ class CommandOSLogin : public Command public: CommandOSLogin(Module *creator) : Command(creator, "operserv/login", 1, 1) { + this->SetFlag(CFLAG_REQUIRE_USER); this->SetDesc(Anope::printf(_("Login to %s"), Config->OperServ.c_str())); this->SetSyntax(_("\037password\037")); } @@ -28,9 +29,6 @@ class CommandOSLogin : public Command const Anope::string &password = params[0]; User *u = source.GetUser(); - if (!u) - return; - Oper *o = source.nc->o; if (o == NULL) source.Reply(_("No oper block for your nick.")); @@ -69,16 +67,14 @@ class CommandOSLogout : public Command public: CommandOSLogout(Module *creator) : Command(creator, "operserv/logout", 0, 0) { - this->SetDesc(Anope::printf(_("Logout from to %s"), Config->OperServ.c_str())); + this->SetFlag(CFLAG_REQUIRE_USER); + this->SetDesc(Anope::printf(_("Logout from %s"), Config->OperServ.c_str())); this->SetSyntax(""); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = source.GetUser(); - if (!u) - return; - Oper *o = source.nc->o; if (o == NULL) source.Reply(_("No oper block for your nick.")); |