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 | |
parent | 1730bfb2bc2a664f6b555152c1251384669ee661 (diff) |
Made os_forbid honor nssecureadmins
-rw-r--r-- | include/account.h | 4 | ||||
-rw-r--r-- | modules/commands/os_forbid.cpp | 33 |
2 files changed, 33 insertions, 4 deletions
diff --git a/include/account.h b/include/account.h index 7879a578e..23b09b7de 100644 --- a/include/account.h +++ b/include/account.h @@ -92,8 +92,6 @@ enum NickCoreFlag NI_SUSPENDED, /* Autoop nickname in channels */ NI_AUTOOP, - /* This nickcore is forbidden, which means the nickalias for it is aswell */ - NI_FORBIDDEN, /* If set means the nick core does not have their email addrses confirmed. */ NI_UNCONFIRMED, @@ -106,7 +104,7 @@ enum NickCoreFlag const Anope::string NickCoreFlagStrings[] = { "BEGIN", "KILLPROTECT", "SECURE", "MSG", "MEMO_HARDMAX", "MEMO_SIGNON", "MEMO_RECEIVE", "PRIVATE", "HIDE_EMAIL", "HIDE_MASK", "HIDE_QUIT", "KILL_QUICK", "KILL_IMMED", - "MEMO_MAIL", "HIDE_STATUS", "SUSPENDED", "AUTOOP", "FORBIDDEN", "UNCONFIRMED", "STATS", "" + "MEMO_MAIL", "HIDE_STATUS", "SUSPENDED", "AUTOOP", "UNCONFIRMED", "STATS", "" }; /* It matters that Base is here before Extensible (it is inherited by Serializable) */ 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) { |