summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-11-04 23:54:04 -0500
committerAdam <Adam@anope.org>2014-11-04 23:54:16 -0500
commit8b64e46ef12df000c51fe7e4fa176fb98ea432d0 (patch)
tree0722253c036741cf6d4a8649b65fde84bad1adf6
parentc4460784c2b3695b9f3a8073fc61712e9f804573 (diff)
Show access denied if /os kick can't kick the target
-rw-r--r--modules/commands/os_kick.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/commands/os_kick.cpp b/modules/commands/os_kick.cpp
index b9867c7a5..811b22e6e 100644
--- a/modules/commands/os_kick.cpp
+++ b/modules/commands/os_kick.cpp
@@ -33,20 +33,26 @@ class CommandOSKick : public Command
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
return;
}
- else if (c->bouncy_modes)
+
+ if (c->bouncy_modes)
{
source.Reply(_("Services is unable to change modes. Are your servers' U:lines configured correctly?"));
return;
}
- else if (!(u2 = User::Find(nick, true)))
+
+ if (!(u2 = User::Find(nick, true)))
{
source.Reply(NICK_X_NOT_IN_USE, nick.c_str());
return;
}
- c->Kick(source.service, u2, "%s (%s)", source.GetNick().c_str(), s.c_str());
+ if (!c->Kick(source.service, u2, "%s (%s)", source.GetNick().c_str(), s.c_str()))
+ {
+ source.Reply(ACCESS_DENIED);
+ return;
+ }
+
Log(LOG_ADMIN, source, this) << "on " << u2->nick << " in " << c->name << " (" << s << ")";
- return;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override