diff options
author | Adam <Adam@anope.org> | 2012-10-30 22:07:15 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-10-30 22:07:15 -0400 |
commit | a39947cd3c6c76cb708de7d328aabde62e39be0b (patch) | |
tree | 5ca3674d58fc572125ee4e804e323c096935708d /modules/commands/os_forbid.cpp | |
parent | 1730bfb2bc2a664f6b555152c1251384669ee661 (diff) |
Made os_forbid honor nssecureadmins
Diffstat (limited to 'modules/commands/os_forbid.cpp')
-rw-r--r-- | modules/commands/os_forbid.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 5f1d1d0ed..31ca94265 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -127,6 +127,13 @@ class CommandOSForbid : public Command expiryt += Anope::CurTime; } + NickAlias *target = findnick(entry); + if (target != NULL && Config->NSSecureAdmins && target->nc->IsServicesOper()) + { + source.Reply(ACCESS_DENIED); + return; + } + ForbidData *d = this->fs->FindForbid(entry, ftype); bool created = false; if (d == NULL) @@ -304,7 +311,31 @@ class OSForbid : public Module EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override { - if (source.IsOper()) + if (command->name == "nickserv/info" && params.size() > 0) + { + ForbidData *d = this->forbidService.FindForbid(params[0], FT_NICK); + if (d != NULL) + { + if (source.IsOper()) + source.Reply(_("Nick \2%s\2 is forbidden by %s: %s"), params[0].c_str(), d->creator.c_str(), d->reason.c_str()); + else + source.Reply(_("Nick \2%s\2 is forbidden."), params[0].c_str()); + return EVENT_STOP; + } + } + else if (command->name == "chanserv/info" && params.size() > 0) + { + ForbidData *d = this->forbidService.FindForbid(params[0], FT_CHAN); + if (d != NULL) + { + if (source.IsOper()) + source.Reply(_("Channel \2%s\2 is forbidden by %s: %s"), params[0].c_str(), d->creator.c_str(), d->reason.c_str()); + else + source.Reply(_("Channel \2%s\2 is forbidden."), params[0].c_str()); + return EVENT_STOP; + } + } + else if (source.IsOper()) return EVENT_CONTINUE; else if (command->name == "nickserv/register" && params.size() > 1) { |