diff options
-rw-r--r-- | data/example.conf | 1 | ||||
-rw-r--r-- | modules/commands/bs_control.cpp | 22 | ||||
-rw-r--r-- | modules/commands/cs_akick.cpp | 7 | ||||
-rw-r--r-- | modules/commands/cs_ban.cpp | 8 | ||||
-rw-r--r-- | modules/commands/cs_kick.cpp | 8 |
5 files changed, 23 insertions, 23 deletions
diff --git a/data/example.conf b/data/example.conf index d0b02593e..e030a24f4 100644 --- a/data/example.conf +++ b/data/example.conf @@ -741,6 +741,7 @@ log * chanserv/auspex - Can see any information with /chanserv info * chanserv/no-register-limit - May register an unlimited number of channels and nicknames * chanserv/set - Can modify the settings of any channel (incl. changing of the owner!) + * chanserv/kick - Can kick and ban users from channels through ChanServ * memoserv/info - Can see any information with /memoserv info * memoserv/set-limit - Can set the limit of max stored memos on any user and channel * memoserv/no-limit - Can send memos through limits and throttles diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp index 37dc2c489..d78ca6851 100644 --- a/modules/commands/bs_control.cpp +++ b/modules/commands/bs_control.cpp @@ -33,7 +33,7 @@ class CommandBSSay : public Command return; } - if (!source.AccessFor(ci).HasPriv("SAY")) + if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration")) { source.Reply(ACCESS_DENIED); return; @@ -60,10 +60,8 @@ class CommandBSSay : public Command IRCD->SendPrivmsg(ci->bi, ci->name, "%s", text.c_str()); ci->bi->lastmsg = Anope::CurTime; - // XXX need a way to find if someone is overriding this - Log(LOG_COMMAND, source, this, ci) << text; - - return; + bool override = !source.AccessFor(ci).HasPriv("SAY"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text; } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override @@ -95,7 +93,7 @@ class CommandBSAct : public Command return; } - if (!source.AccessFor(ci).HasPriv("SAY")) + if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration")) { source.Reply(ACCESS_DENIED); return; @@ -113,17 +111,15 @@ class CommandBSAct : public Command return; } - size_t i = 0; - while ((i = message.find(1)) && i != Anope::string::npos) - message.erase(i, 1); + message = message.replace_all_cs("\1", ""); + if (message.empty()) + return; IRCD->SendAction(ci->bi, ci->name, "%s", message.c_str()); ci->bi->lastmsg = Anope::CurTime; - // XXX Need to be able to find if someone is overriding this. - Log(LOG_COMMAND, source, this, ci) << message; - - return; + bool override = !source.AccessFor(ci).HasPriv("SAY"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message; } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index dea6446ba..b388620fc 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -83,9 +83,13 @@ class CommandCSAKick : public Command } } + bool override = !source.AccessFor(ci).HasPriv("AKICK"); + /* Opers overriding get to bypass PEACE */ + if (override) + ; /* Check whether target nick has equal/higher access * or whether the mask matches a user with higher/equal access - Viper */ - if (ci->HasExt("PEACE") && nc) + else if (ci->HasExt("PEACE") && nc) { AccessGroup nc_access = ci->AccessFor(nc), u_access = source.AccessFor(ci); if (nc == ci->GetFounder() || nc_access >= u_access) @@ -152,7 +156,6 @@ class CommandCSAKick : public Command else akick = ci->AddAkick(source.GetNick(), mask, reason); - bool override = !source.AccessFor(ci).HasPriv("AKICK"); Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to add " << mask << (reason == "" ? "" : ": ") << reason; FOREACH_MOD(I_OnAkickAdd, OnAkickAdd(source, ci, akick)); diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 2da17bb98..c39f7f392 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -90,13 +90,13 @@ class CommandCSBan : public Command if (!c) source.Reply(CHAN_X_NOT_IN_USE, chan.c_str()); - else if (!u_access.HasPriv("BAN")) + else if (!u_access.HasPriv("BAN") && !source.HasPriv("chanserv/kick")) source.Reply(ACCESS_DENIED); else if (u2) { AccessGroup u2_access = ci->AccessFor(u2); - if (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access) + if (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access && !source.HasPriv("chanserv/kick")) source.Reply(ACCESS_DENIED); /* * Dont ban/kick the user on channels where he is excepted @@ -110,8 +110,8 @@ class CommandCSBan : public Command { Anope::string mask = ci->GetIdealBan(u2); - // XXX need a way to detect if someone is overriding - Log(LOG_COMMAND, source, this, ci) << "for " << mask; + bool override = !u_access.HasPriv("BAN") || (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << mask; if (!c->HasMode("BAN", mask)) { diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index 062c8f04d..03beaf0a8 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -50,12 +50,12 @@ class CommandCSKick : public Command AccessGroup u_access = source.AccessFor(ci); - if (!u_access.HasPriv("KICK")) + if (!u_access.HasPriv("KICK") && !source.HasPriv("chanserv/kick")) source.Reply(ACCESS_DENIED); else if (u2) { AccessGroup u2_access = ci->AccessFor(u2); - if (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access) + if (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access && !source.HasPriv("chanserv/kick")) source.Reply(ACCESS_DENIED); else if (u2->IsProtected()) source.Reply(ACCESS_DENIED); @@ -63,8 +63,8 @@ class CommandCSKick : public Command source.Reply(NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str()); else { - // XXX - Log(LOG_COMMAND, source, this, ci) << "for " << u2->nick; + bool override = !u_access.HasPriv("KICK") || (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << u2->nick; if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK"))) c->Kick(ci->WhoSends(), u2, "%s (%s)", reason.c_str(), source.GetNick().c_str()); |