diff options
author | Adam <Adam@anope.org> | 2011-02-12 16:17:17 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-02-12 16:17:17 -0500 |
commit | 1372dc19537ce270f1f02979101f9b8678b5ff28 (patch) | |
tree | d56f688ec113293a2e40c78d615558f1163dad7b | |
parent | 9ef7352e69bc092bba77a085dfa0f91a5793e038 (diff) |
Removed the Wallop config options and replaced them with the new log system
-rw-r--r-- | data/example.conf | 32 | ||||
-rw-r--r-- | docs/Changes.conf | 2 | ||||
-rw-r--r-- | include/config.h | 26 | ||||
-rw-r--r-- | modules/core/cs_forbid.cpp | 2 | ||||
-rw-r--r-- | modules/core/cs_suspend.cpp | 6 | ||||
-rw-r--r-- | modules/core/ns_drop.cpp | 5 | ||||
-rw-r--r-- | modules/core/ns_forbid.cpp | 3 | ||||
-rw-r--r-- | modules/core/ns_getpass.cpp | 4 | ||||
-rw-r--r-- | modules/core/ns_saset.cpp | 3 | ||||
-rw-r--r-- | modules/core/ns_suspend.cpp | 6 | ||||
-rw-r--r-- | modules/core/os_akill.cpp | 33 | ||||
-rw-r--r-- | modules/core/os_chankill.cpp | 4 | ||||
-rw-r--r-- | modules/core/os_global.cpp | 3 | ||||
-rw-r--r-- | modules/core/os_jupe.cpp | 3 | ||||
-rw-r--r-- | modules/core/os_kick.cpp | 3 | ||||
-rw-r--r-- | modules/core/os_mode.cpp | 6 | ||||
-rw-r--r-- | modules/core/os_noop.cpp | 3 | ||||
-rw-r--r-- | modules/core/os_snline.cpp | 34 | ||||
-rw-r--r-- | modules/core/os_sqline.cpp | 34 | ||||
-rw-r--r-- | modules/core/os_szline.cpp | 34 | ||||
-rw-r--r-- | src/config.cpp | 31 | ||||
-rw-r--r-- | src/logger.cpp | 9 | ||||
-rw-r--r-- | src/misc.cpp | 23 |
23 files changed, 48 insertions, 261 deletions
diff --git a/data/example.conf b/data/example.conf index 3b8e2fd18..61f5069f0 100644 --- a/data/example.conf +++ b/data/example.conf @@ -588,8 +588,10 @@ options log { /* - * Target(s) to log to. If it starts with a # it is assumed to be a channel, otherwise - * it will log to a file. + * Target(s) to log to, which may be one of the following: + * - a channel name + * - globops + * - filename */ target = "services.log" /* Log to both services.log and the channel #services */ @@ -661,6 +663,15 @@ log } /* + * A log block to globops some useful things. + */ +log +{ + target = "globops" + admin = "operserv/global operserv/mode operserv/kick opeserv/akill operserv/s*line operserv/noop operserv/jupe */forbid nickserv/getpass */drop" +} + +/* * [RECOMMENDED] Oper Access Config * * This section is used to set up staff access to restricted oper only commands. @@ -1527,30 +1538,15 @@ operserv * The notifications are: * - oper: A user has become an IRC operator * - bados: A non-IRCop attempts to use OperServ - * - osglobal: OperServ's GLOBAL command was used - * - osmode: OperServ's MODE command was used - * - oskick: OperServ's KICK command was used - * - osakill: OperServ's AKILL command was used - * - ossnline: OperServ's SNLINE command was used - * - ossqline: OperServ's SQLINE command was used - * - osszline: OperServ's SZLINE command was used - * - osnoop: OperServ's NOOP command was used - * - osjupe: OperServ's JUPE command was used * - akillexpire: An AKILL has expired * - snlineexpire: An SNLINE has expired * - sqlineexpire: An SQLINE has expired * - szlineexpire: An SZLINE has expired * - exceptionexpire: A session exception has expired - * - getpass: NickServ's or ChanServ's GETPASS command was used - * - setpass: A Services Admin has set the password of a nickname or channel they do - * not normally have access to - * - forbid: NickServ's or ChanServ's FORBID command was used - * - drop: A Services Admin has dropped a nickname or channel they do not normally - * have access to * * This directive is optional, if left blank, there will be no notifications. */ - notifications="osglobal osmode oskick osakill ossnline ossqline osszline osnoop osjupe getpass setpass forbid drop" + notifications="oper" /* * Enables session limiting. Session limiting prevents users from connecting more than a certain diff --git a/docs/Changes.conf b/docs/Changes.conf index 2ce35ed2a..c8c9c9719 100644 --- a/docs/Changes.conf +++ b/docs/Changes.conf @@ -9,6 +9,8 @@ nickserv:modules added ns_ajoin options:nomlock added opertype:commands removed operserv/umode operserv:modules removed os_umode +operserv:notifications removed osglobal, osmode, oskick, osakill, ossnline, ossqline, osszline, osnoop, osjupe, getpass, setpass, forbid, drop +log:target added globops Anope Version 1.9.3 ------------------ diff --git a/include/config.h b/include/config.h index f923b76b0..cbe36d4f7 100644 --- a/include/config.h +++ b/include/config.h @@ -719,24 +719,6 @@ class CoreExport ServerConfig bool WallOper; /* Send a WALLOPS/GLOBOPS when a nonoper tries to use OperServ */ bool WallBadOS; - /* Send a WALLOPS/GLOBOPS when someone uses the GLOBAL command */ - bool WallOSGlobal; - /* Send a WALLOPS/GLOBOPS when someone uses the MODE command */ - bool WallOSMode; - /* Send a WALLOPS/GLOBOPS when someone uses the KICK command */ - bool WallOSKick; - /* Send a WALLOPS/GLOBOPS when someone uses the AKILL command */ - bool WallOSAkill; - /* Send a WALLOPS/GLOBOPS when someone uses the SNLINE command */ - bool WallOSSNLine; - /* Send a WALLOPS/GLOBOPS when someone uses the SQLINE command */ - bool WallOSSQLine; - /* Send a WALLOPS/GLOBOPS when someone uses the SZLINE command */ - bool WallOSSZLine; - /* Send a WALLOPS/GLOBOPS when someone uses the NOOP command */ - bool WallOSNoOp; - /* Send a WALLOPS/GLOBOPS when when someone uses the JUPE command */ - bool WallOSJupe; /* Send a WALLOPS/GLOBOPS when an akill expires */ bool WallAkillExpire; /* Send a WALLOPS/GLOBOPS when SNLines expire */ @@ -747,14 +729,6 @@ class CoreExport ServerConfig bool WallSZLineExpire; /* Send a WALLOPS/GLOBOPS when exceptions expire */ bool WallExceptionExpire; - /* Send a WALLOPS/GLOBOPS when DROP is used */ - bool WallDrop; - /* Send a WALLOPS/GLOBOPS when FORBID is used */ - bool WallForbid; - /* Send a WALLOPS/GLOBOPS when GETPASS is used */ - bool WallGetpass; - /* Send a WALLOPS/GLOBOPS when SETPASS is used */ - bool WallSetpass; /* Add the akillers nick to the akill reason */ bool AddAkiller; diff --git a/modules/core/cs_forbid.cpp b/modules/core/cs_forbid.cpp index d4dc42c68..dabf27f2b 100644 --- a/modules/core/cs_forbid.cpp +++ b/modules/core/cs_forbid.cpp @@ -85,8 +85,6 @@ class CommandCSForbid : public Command ircdproto->SendSQLine(&x); } - if (Config->WallForbid) - ircdproto->SendGlobops(ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); Log(LOG_ADMIN, u, this, ci) << (!ci->forbidreason.empty() ? ci->forbidreason : "No reason"); source.Reply(_("Channel \002%s\002 is now forbidden."), chan.c_str()); diff --git a/modules/core/cs_suspend.cpp b/modules/core/cs_suspend.cpp index bce98c205..82eac64a2 100644 --- a/modules/core/cs_suspend.cpp +++ b/modules/core/cs_suspend.cpp @@ -64,9 +64,6 @@ class CommandCSSuspend : public Command } } - if (Config->WallForbid) - ircdproto->SendGlobops(ChanServ, "\2%s\2 used SUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); - Log(LOG_ADMIN, u, this, ci) << (!reason.empty() ? reason : "No reason"); source.Reply(_("Channel \002%s\002 is now suspended."), ci->name.c_str()); @@ -123,9 +120,6 @@ class CommandCSUnSuspend : public Command ci->forbidreason.clear(); ci->forbidby.clear(); - if (Config->WallForbid) - ircdproto->SendGlobops(ChanServ, "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); - source.Reply(_("Channel \002%s\002 is now released."), ci->name.c_str()); FOREACH_MOD(I_OnChanUnsuspend, OnChanUnsuspend(ci)); diff --git a/modules/core/ns_drop.cpp b/modules/core/ns_drop.cpp index cc407e1b2..83981fe0e 100644 --- a/modules/core/ns_drop.cpp +++ b/modules/core/ns_drop.cpp @@ -39,9 +39,6 @@ class CommandNSDrop : public Command NickRequest *nr = findrequestnick(u->Account() && !nick.empty() ? nick : u->nick); if (nr && u->Account() && u->Account()->IsServicesOper()) { - if (Config->WallDrop) - ircdproto->SendGlobops(NickServ, "\2%s\2 used DROP on \2%s\2", u->nick.c_str(), nick.c_str()); - Log(LOG_ADMIN, u, this) << "to drop nickname " << nr->nick << " (email: " << nr->email << ")"; delete nr; source.Reply(_("Nickname \002%s\002 has been dropped."), nick.c_str()); @@ -99,8 +96,6 @@ class CommandNSDrop : public Command if (!is_mine) { - if (Config->WallDrop) - ircdproto->SendGlobops(NickServ, "\2%s\2 used DROP on \2%s\2", u->nick.c_str(), nick.c_str()); source.Reply(_("Nickname \002%s\002 has been dropped."), nick.c_str()); } else diff --git a/modules/core/ns_forbid.cpp b/modules/core/ns_forbid.cpp index 15bd2ee7a..e6fbc89d3 100644 --- a/modules/core/ns_forbid.cpp +++ b/modules/core/ns_forbid.cpp @@ -74,9 +74,6 @@ class CommandNSForbid : public Command ircdproto->SendSQLine(&x); } - if (Config->WallForbid) - ircdproto->SendGlobops(NickServ, "\2%s\2 used FORBID on \2%s\2", u->nick.c_str(), nick.c_str()); - Log(LOG_ADMIN, u, this) << "to forbid nick " << nick; source.Reply(_("Nick \002%s\002 is now forbidden."), nick.c_str()); diff --git a/modules/core/ns_getpass.cpp b/modules/core/ns_getpass.cpp index cd79512fb..a78e2eb95 100644 --- a/modules/core/ns_getpass.cpp +++ b/modules/core/ns_getpass.cpp @@ -34,8 +34,6 @@ class CommandNSGetPass : public Command if ((nr = findrequestnick(nick))) { Log(LOG_ADMIN, u, this) << "for " << nr->nick; - if (Config->WallGetpass) - ircdproto->SendGlobops(NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick.c_str(), nick.c_str()); source.Reply(_("Passcode for %s is \002%s\002."), nick.c_str(), nr->passcode.c_str()); } else @@ -50,8 +48,6 @@ class CommandNSGetPass : public Command if (enc_decrypt(na->nc->pass, tmp_pass) == 1) { Log(LOG_ADMIN, u, this) << "for " << nick; - if (Config->WallGetpass) - ircdproto->SendGlobops(NickServ, "\2%s\2 used GETPASS on \2%s\2", u->nick.c_str(), nick.c_str()); source.Reply(_("Password for %s is \002%s\002."), nick.c_str(), tmp_pass.c_str()); } else diff --git a/modules/core/ns_saset.cpp b/modules/core/ns_saset.cpp index a484e8b04..0aeab4d95 100644 --- a/modules/core/ns_saset.cpp +++ b/modules/core/ns_saset.cpp @@ -214,9 +214,6 @@ class CommandNSSASetPassword : public Command else source.Reply(LanguageString::NICK_SASET_PASSWORD_CHANGED, nc->display.c_str()); - if (Config->WallSetpass) - ircdproto->SendGlobops(NickServ, "\2%s\2 used SASET PASSWORD on \2%s\2", u->nick.c_str(), nc->display.c_str()); - return MOD_CONT; } diff --git a/modules/core/ns_suspend.cpp b/modules/core/ns_suspend.cpp index a4e7dc785..159ec0196 100644 --- a/modules/core/ns_suspend.cpp +++ b/modules/core/ns_suspend.cpp @@ -76,9 +76,6 @@ class CommandNSSuspend : public Command } } - if (Config->WallForbid) - ircdproto->SendGlobops(NickServ, "\2%s\2 used SUSPEND on \2%s\2", u->nick.c_str(), nick.c_str()); - Log(LOG_ADMIN, u, this) << "for " << nick << " (" << (!reason.empty() ? reason : "No reason") << ")"; source.Reply(_("Nick %s is now suspended."), nick.c_str()); @@ -140,9 +137,6 @@ class CommandNSUnSuspend : public Command na->nc->UnsetFlag(NI_SUSPENDED); - if (Config->WallForbid) - ircdproto->SendGlobops(NickServ, "\2%s\2 used UNSUSPEND on \2%s\2", u->nick.c_str(), nick.c_str()); - Log(LOG_ADMIN, u, this) << "for " << na->nick; source.Reply(_("Nick %s is now released."), nick.c_str()); diff --git a/modules/core/os_akill.cpp b/modules/core/os_akill.cpp index 63c6c3700..b2396e360 100644 --- a/modules/core/os_akill.cpp +++ b/modules/core/os_akill.cpp @@ -195,38 +195,7 @@ class CommandOSAKill : public Command source.Reply(_("\002%s\002 added to the AKILL list."), mask.c_str()); - if (Config->WallOSAkill) - { - Anope::string buf; - - if (!expires) - buf = "does not expire"; - else - { - time_t wall_expiry = expires - Anope::CurTime; - Anope::string s; - - if (wall_expiry >= 86400) - { - wall_expiry /= 86400; - s = "day"; - } - else if (wall_expiry >= 3600) - { - wall_expiry /= 3600; - s = "hour"; - } - else if (wall_expiry >= 60) - { - wall_expiry /= 60; - s = "minute"; - } - - buf = "expires in " + stringify(wall_expiry) + " " + s + (wall_expiry == 1 ? "" : "s"); - } - - ircdproto->SendGlobops(OperServ, "%s added an AKILL for %s (%s) (%s) [affects %i user(s) (%.2f%%)]", u->nick.c_str(), mask.c_str(), reason.c_str(), buf.c_str(), affected, percent); - } + Log(LOG_ADMIN, u, this) << "on " << mask << " (" << reason << ") expires in " << duration(NULL, expires - Anope::CurTime) << " [affects " << affected << " user(s) (" << percent << "%)]"; if (readonly) source.Reply(LanguageString::READ_ONLY_MODE); diff --git a/modules/core/os_chankill.cpp b/modules/core/os_chankill.cpp index 6fa4fdeae..2d1ed23cd 100644 --- a/modules/core/os_chankill.cpp +++ b/modules/core/os_chankill.cpp @@ -77,8 +77,8 @@ class CommandOSChanKill : public Command SGLine->Add(OperServ, u, "*@" + uc->user->host, expires, realreason); SGLine->Check(uc->user); } - if (Config->WallOSAkill) - ircdproto->SendGlobops(OperServ, "%s used CHANKILL on %s (%s)", u->nick.c_str(), channel.c_str(), realreason.c_str()); + + Log(LOG_ADMIN, u, this) << "(" << realreason << ")"; } else source.Reply(LanguageString::CHAN_X_NOT_IN_USE, channel.c_str()); diff --git a/modules/core/os_global.cpp b/modules/core/os_global.cpp index 7803ec776..04584ed40 100644 --- a/modules/core/os_global.cpp +++ b/modules/core/os_global.cpp @@ -26,8 +26,7 @@ class CommandOSGlobal : public Command User *u = source.u; const Anope::string &msg = params[0]; - if (Config->WallOSGlobal) - ircdproto->SendGlobops(OperServ, "\2%s\2 just used GLOBAL command.", u->nick.c_str()); + Log(LOG_ADMIN, u, this); oper_global(u->nick, "%s", msg.c_str()); return MOD_CONT; } diff --git a/modules/core/os_jupe.cpp b/modules/core/os_jupe.cpp index 90f8e9821..c1ed47ec6 100644 --- a/modules/core/os_jupe.cpp +++ b/modules/core/os_jupe.cpp @@ -40,8 +40,7 @@ class CommandOSJupe : public Command Server *juped_server = new Server(Me, jserver, 1, rbuf, ircd->ts6 ? ts6_sid_retrieve() : "", SERVER_JUPED); ircdproto->SendServer(juped_server); - if (Config->WallOSJupe) - ircdproto->SendGlobops(OperServ, "\2%s\2 used JUPE on \2%s\2", u->nick.c_str(), jserver.c_str()); + Log(LOG_ADMIN, u, this) << "on " << jserver << " (" << rbuf << ")"; } return MOD_CONT; } diff --git a/modules/core/os_kick.cpp b/modules/core/os_kick.cpp index cf93ada17..a0f81acbe 100644 --- a/modules/core/os_kick.cpp +++ b/modules/core/os_kick.cpp @@ -47,8 +47,7 @@ class CommandOSKick : public Command } c->Kick(OperServ, u2, "%s (%s)", u->nick.c_str(), s.c_str()); - if (Config->WallOSKick) - ircdproto->SendGlobops(OperServ, "%s used KICK on %s/%s", u->nick.c_str(), u2->nick.c_str(), chan.c_str()); + Log(LOG_ADMIN, u, this) << "on " << u2->nick << " in " << c->name; return MOD_CONT; } diff --git a/modules/core/os_mode.cpp b/modules/core/os_mode.cpp index 3ded8a538..74c458704 100644 --- a/modules/core/os_mode.cpp +++ b/modules/core/os_mode.cpp @@ -38,8 +38,7 @@ class CommandOSMode : public Command { c->SetModes(OperServ, false, modes.c_str()); - if (Config->WallOSMode) - ircdproto->SendGlobops(OperServ, "\2%s\2 used MODE %s on %s", u->nick.c_str(), modes.c_str(), c->name.c_str()); + Log(LOG_ADMIN, u, this) << modes << " on " << target; } } else @@ -54,8 +53,7 @@ class CommandOSMode : public Command u2->SendMessage(OperServ, _("\002%s\002 changed your usermodes to %s."), u->nick.c_str(), modes.c_str()); - if (Config->WallOSMode) - ircdproto->SendGlobops(OperServ, "\2%s\2 used MODE %s %s", u->nick.c_str(), modes.c_str(), u2->nick.c_str()); + Log(LOG_ADMIN, u, this) << modes << " on " << target; } } diff --git a/modules/core/os_noop.cpp b/modules/core/os_noop.cpp index 18615b9c2..95fc7a360 100644 --- a/modules/core/os_noop.cpp +++ b/modules/core/os_noop.cpp @@ -35,8 +35,7 @@ class CommandOSNOOP : public Command ircdproto->SendSVSNOOP(server, 1); reason = "NOOP command used by " + u->nick; - if (Config->WallOSNoOp) - ircdproto->SendGlobops(OperServ, "\2%s\2 used NOOP on \2%s\2", u->nick.c_str(), server.c_str()); + Log(LOG_ADMIN, u, this) << "on " << server; source.Reply(_("All O:lines of \002%s\002 have been removed."), server.c_str()); /* Kill all the IRCops of the server */ diff --git a/modules/core/os_snline.cpp b/modules/core/os_snline.cpp index c36d8bf63..8a03c73a3 100644 --- a/modules/core/os_snline.cpp +++ b/modules/core/os_snline.cpp @@ -208,39 +208,7 @@ class CommandOSSNLine : public Command return MOD_CONT; source.Reply(_("\002%s\002 added to the SNLINE list."), mask.c_str()); - - if (Config->WallOSSNLine) - { - Anope::string buf; - - if (!expires) - buf = "does not expire"; - else - { - time_t wall_expiry = expires - Anope::CurTime; - Anope::string s; - - if (wall_expiry >= 86400) - { - wall_expiry /= 86400; - s = "day"; - } - else if (wall_expiry >= 3600) - { - wall_expiry /= 3600; - s = "hour"; - } - else if (wall_expiry >= 60) - { - wall_expiry /= 60; - s = "minute"; - } - - buf = "expires in " + stringify(wall_expiry) + " " + s + (wall_expiry == 1 ? "" : "s"); - } - - ircdproto->SendGlobops(findbot(Config->s_OperServ), "%s added an SNLINE for %s (%s) [affects %i user(s) (%.2f%%)]", u->nick.c_str(), mask.c_str(), buf.c_str(), affected, percent); - } + Log(LOG_ADMIN, u, this) << "on " << mask << " (" << reason << ") expires in " << duration(NULL, expires - Anope::CurTime) << " [affects " << affected << " user(s) (" << percent << "%)]"; if (readonly) source.Reply(LanguageString::READ_ONLY_MODE); diff --git a/modules/core/os_sqline.cpp b/modules/core/os_sqline.cpp index 16ff9bd12..544956dee 100644 --- a/modules/core/os_sqline.cpp +++ b/modules/core/os_sqline.cpp @@ -188,39 +188,7 @@ class CommandOSSQLine : public Command return MOD_CONT; source.Reply(_("\002%s\002 added to the SQLINE list."), mask.c_str()); - - if (Config->WallOSSQLine) - { - Anope::string buf; - - if (!expires) - buf = "does not expire"; - else - { - time_t wall_expiry = expires - Anope::CurTime; - Anope::string s; - - if (wall_expiry >= 86400) - { - wall_expiry /= 86400; - s = "day"; - } - else if (wall_expiry >= 3600) - { - wall_expiry /= 3600; - s = "hour"; - } - else if (wall_expiry >= 60) - { - wall_expiry /= 60; - s = "minute"; - } - - buf = "expires in " + stringify(wall_expiry) + " " + s + (wall_expiry == 1 ? "" : "s"); - } - - ircdproto->SendGlobops(OperServ, "%s added an SQLINE for %s (%s) [affects %i user(s) (%.2f%%)]", u->nick.c_str(), mask.c_str(), buf.c_str(), affected, percent); - } + Log(LOG_ADMIN, u, this) << "on " << mask << " (" << reason << ") expires in " << duration(NULL, expires - Anope::CurTime) << " [affects " << affected << " user(s) (" << percent << "%)]"; if (readonly) source.Reply(LanguageString::READ_ONLY_MODE); diff --git a/modules/core/os_szline.cpp b/modules/core/os_szline.cpp index 23ed98aa6..899ba69b7 100644 --- a/modules/core/os_szline.cpp +++ b/modules/core/os_szline.cpp @@ -192,39 +192,7 @@ class CommandOSSZLine : public Command return MOD_CONT; source.Reply(_("\002%s\002 added to the SZLINE list."), mask.c_str()); - - if (Config->WallOSSZLine) - { - Anope::string buf; - - if (!expires) - buf = "does not expire"; - else - { - time_t wall_expiry = expires - Anope::CurTime; - Anope::string s; - - if (wall_expiry >= 86400) - { - wall_expiry /= 86400; - s = "day"; - } - else if (wall_expiry >= 3600) - { - wall_expiry /= 3600; - s = "hour"; - } - else if (wall_expiry >= 60) - { - wall_expiry /= 60; - s = "minute"; - } - - buf = "expires in " + stringify(wall_expiry) + " " + s + (wall_expiry == 1 ? "" : "s"); - } - - ircdproto->SendGlobops(OperServ, "%s added an SZLINE for %s (%s) [affects %i user(s) (%.2f%%)]", u->nick.c_str(), mask.c_str(), buf.c_str(), affected, percent); - } + Log(LOG_ADMIN, u, this) << "on " << mask << " (" << reason << ") expires in " << duration(NULL, expires - Anope::CurTime) << " [affects " << affected << " user(s) (" << percent << "%)]"; if (readonly) source.Reply(LanguageString::READ_ONLY_MODE); diff --git a/src/config.cpp b/src/config.cpp index 17659bc02..6bf0a522f 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -167,9 +167,8 @@ ServerConfig::ServerConfig() : errstr(""), config_data(), NSDefFlags(NickCoreFla } } - this->WallOper = this->WallBadOS = this->WallOSGlobal = this->WallOSMode = this->WallOSKick = this->WallOSAkill = this->WallOSSNLine = this->WallOSSQLine = - this->WallOSSZLine = this->WallOSNoOp = this->WallOSJupe = this->WallAkillExpire = this->WallSNLineExpire = this->WallSQLineExpire = this->WallSZLineExpire = this->WallExceptionExpire = - this->WallGetpass = this->WallSetpass = this->WallForbid = this->WallDrop = false; + this->WallOper = this->WallBadOS = this->WallAkillExpire = this->WallSNLineExpire = this->WallSQLineExpire = + this->WallSZLineExpire = this->WallExceptionExpire = false; if (!OSNotifications.empty()) { spacesepstream notifications(OSNotifications); @@ -180,24 +179,6 @@ ServerConfig::ServerConfig() : errstr(""), config_data(), NSDefFlags(NickCoreFla this->WallOper = true; else if (notice.equals_ci("bados")) this->WallBadOS = true; - else if (notice.equals_ci("osglobal")) - this->WallOSGlobal = true; - else if (notice.equals_ci("osmode")) - this->WallOSMode = true; - else if (notice.equals_ci("oskick")) - this->WallOSKick = true; - else if (notice.equals_ci("osakill")) - this->WallOSAkill = true; - else if (notice.equals_ci("ossnline")) - this->WallOSSNLine = true; - else if (notice.equals_ci("ossqline")) - this->WallOSSQLine = true; - else if (notice.equals_ci("osszline")) - this->WallOSSZLine = true; - else if (notice.equals_ci("osnoop")) - this->WallOSNoOp = true; - else if (notice.equals_ci("osjupe")) - this->WallOSJupe = true; else if (notice.equals_ci("akillexpire")) this->WallAkillExpire = true; else if (notice.equals_ci("snlineexpire")) @@ -208,14 +189,6 @@ ServerConfig::ServerConfig() : errstr(""), config_data(), NSDefFlags(NickCoreFla this->WallSZLineExpire = true; else if (notice.equals_ci("exceptionexpire")) this->WallExceptionExpire = true; - else if (notice.equals_ci("getpass")) - this->WallGetpass = true; - else if (notice.equals_ci("setpass")) - this->WallSetpass = true; - else if (notice.equals_ci("forbid")) - this->WallForbid = true; - else if (notice.equals_ci("drop")) - this->WallDrop = true; } } diff --git a/src/logger.cpp b/src/logger.cpp index 1328e4f57..42bac03cb 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -265,7 +265,9 @@ std::list<Anope::string> &LogInfo::GetList(LogType type) switch (type) { case LOG_ADMIN: + return this->Admin; case LOG_OVERRIDE: + return this->Override; case LOG_COMMAND: return this->Commands; case LOG_SERVER: @@ -348,6 +350,13 @@ void LogInfo::ProcessMessage(const Log *l) ircdproto->SendPrivmsg(l->bi, c->name, "%s", l->buf.str().c_str()); } } + else if (target == "globops") + { + if (UplinkSock && l->bi && l->Type <= LOG_NORMAL && Me && Me->IsSynced()) + { + ircdproto->SendGlobops(l->bi, "%s", l->buf.str().c_str()); + } + } else { LogFile *log = NULL; diff --git a/src/misc.cpp b/src/misc.cpp index 340207cb0..daf7fe363 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -245,39 +245,34 @@ time_t dotime(const Anope::string &s) Anope::string duration(NickCore *nc, time_t seconds) { /* We first calculate everything */ - int days = seconds / 86400; + time_t days = seconds / 86400; seconds -= (days * 86400); - int hours = seconds / 3600; + time_t hours = seconds / 3600; seconds -= (hours * 3600); - int minutes = seconds / 60; + time_t minutes = seconds / 60; - char buf[64]; Anope::string buffer; if (!days && !hours && !minutes) - { - snprintf(buf, sizeof(buf), GetString(nc, "%d second%s").c_str(), seconds, seconds != 1 ? "s" : ""); - buffer = buf; - } + buffer = stringify(seconds) + " second" + (seconds != 1 ? "s" : ""); else { bool need_comma = false; if (days) { - snprintf(buf, sizeof(buf), GetString(nc, "%d day%s").c_str(), days, days != 1 ? "s" : ""); - buffer = buf; + buffer = stringify(days) + " day" + (days != 1 ? "s" : ""); need_comma = true; } if (hours) { - snprintf(buf, sizeof(buf), GetString(nc, "%d hour%s").c_str(), hours, hours != 1 ? "s" : ""); - buffer += Anope::string(need_comma ? ", " : "") + buf; + buffer += need_comma ? ", " : ""; + buffer += stringify(hours) + " hour" + (hours != 1 ? "s" : ""); need_comma = true; } if (minutes) { - snprintf(buf, sizeof(buf), GetString(nc, "%d minute%s").c_str(), minutes != 1 ? "s" : ""); - buffer += Anope::string(need_comma ? ", " : "") + buf; + buffer += need_comma ? ", " : ""; + buffer += stringify(minutes) + " minute" + (minutes != 1 ? "s" : ""); } } |