1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 09:33:12 +02:00

Made os_forbid honor nssecureadmins

This commit is contained in:
Adam
2012-10-30 22:07:15 -04:00
parent 1730bfb2bc
commit a39947cd3c
2 changed files with 33 additions and 4 deletions
+1 -3
View File
@@ -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) */
+32 -1
View File
@@ -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> &params) 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)
{