diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands/os_defcon.cpp | 8 | ||||
| -rw-r--r-- | modules/commands/os_forbid.cpp | 2 | ||||
| -rw-r--r-- | modules/commands/os_module.cpp | 6 | ||||
| -rw-r--r-- | modules/commands/os_oline.cpp | 4 | ||||
| -rw-r--r-- | modules/commands/os_session.cpp | 14 | ||||
| -rw-r--r-- | modules/commands/os_set.cpp | 2 | ||||
| -rw-r--r-- | modules/commands/os_svsnick.cpp | 2 | ||||
| -rw-r--r-- | modules/pseudoclients/operserv.cpp | 22 |
8 files changed, 27 insertions, 33 deletions
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index 7e40a5c02..3bd1fc111 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -549,13 +549,17 @@ class OSDefcon : public Module if (!Config->SessionLimitDetailsLoc.empty()) ircdproto->SendMessage(findbot(Config->OperServ), u->nick, "%s", Config->SessionLimitDetailsLoc.c_str()); - u->Kill(Config->OperServ, "Defcon session limit exceeded"); ++session->hits; if (akills && Config->MaxSessionKill && session->hits >= Config->MaxSessionKill) { XLine x("*@" + u->host, Config->OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Defcon session limit exceeded", XLineManager::GenerateUID()); akills->Send(NULL, &x); - ircdproto->SendGlobops(findbot(Config->OperServ), "[DEFCON] Added a temporary AKILL for \2*@%s\2 due to excessive connections", u->host.c_str()); + Log(findbot(Config->OperServ), "akill/defcon") << "[DEFCON] Added a temporary AKILL for \2*@" << u->host << "\2 due to excessive connections"; + } + else + { + u->Kill(Config->OperServ, "Defcon session limit exceeded"); + u = NULL; /* No guarentee u still exists */ } } } diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index a60b362db..7d20c5539 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -63,7 +63,7 @@ class MyForbidService : public ForbidService else if (d->type == FT_EMAIL) ftype = "email"; - Log(LOG_NORMAL, Config->OperServ + "/forbid") << "Expiring forbid for " << d->mask << " type " << ftype; + Log(LOG_NORMAL, "expire/forbid") << "Expiring forbid for " << d->mask << " type " << ftype; this->forbidData.erase(this->forbidData.begin() + i - 1); delete d; } diff --git a/modules/commands/os_module.cpp b/modules/commands/os_module.cpp index 074cc1c1a..196a9bed8 100644 --- a/modules/commands/os_module.cpp +++ b/modules/commands/os_module.cpp @@ -30,7 +30,7 @@ class CommandOSModLoad : public Command ModuleReturn status = ModuleManager::LoadModule(mname, u); if (status == MOD_ERR_OK) { - ircdproto->SendGlobops(source.owner, "%s loaded module %s", u->nick.c_str(), mname.c_str()); + Log(LOG_ADMIN, u, this) << "to load module " << mname; source.Reply(_("Module \002%s\002 loaded"), mname.c_str()); } else if (status == MOD_ERR_EXISTS) @@ -91,7 +91,7 @@ class CommandOSModReLoad : public Command status = ModuleManager::LoadModule(mname, u); if (status == MOD_ERR_OK) { - ircdproto->SendGlobops(source.owner, "%s reloaded module %s", u->nick.c_str(), mname.c_str()); + Log(LOG_ADMIN, u, this) << "to reload module " << mname; source.Reply(_("Module \002%s\002 reloaded"), mname.c_str()); } else @@ -150,8 +150,8 @@ class CommandOSModUnLoad : public Command if (status == MOD_ERR_OK) { + Log(LOG_ADMIN, u, this) << "to unload module " << mname; source.Reply(_("Module \002%s\002 unloaded"), mname.c_str()); - ircdproto->SendGlobops(source.owner, "%s unloaded module %s", u->nick.c_str(), mname.c_str()); } else source.Reply(_("Unable to remove module \002%s\002"), mname.c_str()); diff --git a/modules/commands/os_oline.cpp b/modules/commands/os_oline.cpp index 6daae2fed..9ce76d95c 100644 --- a/modules/commands/os_oline.cpp +++ b/modules/commands/os_oline.cpp @@ -38,13 +38,13 @@ class CommandOSOLine : public Command u2->SetMode(source.owner, UMODE_OPER); u2->SendMessage(source.owner, _("You are now an IRC Operator.")); source.Reply(_("Operflags \002%s\002 have been added for \002%s\002."), flag.c_str(), nick.c_str()); - ircdproto->SendGlobops(source.owner, "\2%s\2 used OLINE for %s", u->nick.c_str(), nick.c_str()); + Log(LOG_ADMIN, u, this) << "for " << nick; } else if (u2 && flag[0] == '-') { ircdproto->SendSVSO(Config->OperServ, nick, flag); source.Reply(_("Operflags \002%s\002 have been added for \002%s\002."), flag.c_str(), nick.c_str()); - ircdproto->SendGlobops(source.owner, "\2%s\2 used OLINE for %s", u->nick.c_str(), nick.c_str()); + Log(LOG_ADMIN, u, this) << "for " << nick; } else this->OnSyntaxError(source, ""); diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index c35be7b09..12267b651 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -100,9 +100,7 @@ class ExpireTimer : public Timer if (!e->expires || e->expires > Anope::CurTime) continue; - BotInfo *bi = findbot(Config->OperServ); - if (Config->WallExceptionExpire && bi) - ircdproto->SendGlobops(bi, "Session exception for %s has expired.", e->mask.c_str()); + Log(findbot(Config->OperServ), "expire/exception") << "Session exception for " << e->mask << "has expired."; session_service->DelException(e); delete e; } @@ -646,8 +644,6 @@ class OSSession : public Module u->SendMessage(bi, "%s", Config->SessionLimitDetailsLoc.c_str()); } - u->Kill(Config->OperServ, "Session limit exceeded"); - ++session->hits; if (Config->MaxSessionKill && session->hits >= Config->MaxSessionKill && akills) { @@ -655,8 +651,12 @@ class OSSession : public Module XLine *x = new XLine(akillmask, Config->OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Session limit exceeded", XLineManager::GenerateUID()); akills->AddXLine(x); akills->Send(NULL, x); - if (bi) - ircdproto->SendGlobops(bi, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask.c_str()); + Log(bi, "akill/session") << "Added a temporary AKILL for \2" << akillmask << "\2 due to excessive connections"; + } + else + { + u->Kill(Config->OperServ, "Session limit exceeded"); + u = NULL; /* No guarentee u still exists */ } } } diff --git a/modules/commands/os_set.cpp b/modules/commands/os_set.cpp index fbdfd2814..1cea0e90c 100644 --- a/modules/commands/os_set.cpp +++ b/modules/commands/os_set.cpp @@ -84,14 +84,12 @@ class CommandOSSet : public Command u->SuperAdmin = true; source.Reply(_("You are now a SuperAdmin")); Log(LOG_ADMIN, u, this) << "SUPERADMIN ON"; - ircdproto->SendGlobops(source.owner, _("%s is now a Super-Admin"), u->nick.c_str()); } else if (setting.equals_ci("OFF")) { u->SuperAdmin = false; source.Reply(_("You are no longer a SuperAdmin")); Log(LOG_ADMIN, u, this) << "SUPERADMIN OFF"; - ircdproto->SendGlobops(source.owner, _("%s is no longer a Super-Admin"), u->nick.c_str()); } else source.Reply(_("Setting for SuperAdmin must be \002on\002 or \002off\002 (must be enabled in services.conf)")); diff --git a/modules/commands/os_svsnick.cpp b/modules/commands/os_svsnick.cpp index 1d88779b1..be5f8c320 100644 --- a/modules/commands/os_svsnick.cpp +++ b/modules/commands/os_svsnick.cpp @@ -57,7 +57,7 @@ class CommandOSSVSNick : public Command else { source.Reply(_("The nick \002%s\002 is now being changed to \002%s\002."), nick.c_str(), newnick.c_str()); - ircdproto->SendGlobops(source.owner, "%s used SVSNICK to change %s to %s", u->nick.c_str(), nick.c_str(), newnick.c_str()); + Log(LOG_ADMIN, u, this) << "to change " << nick << " to " << newnick; ircdproto->SendForceNickChange(u2, newnick, Anope::CurTime); } return; diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp index ab7d70887..7dfaf40bb 100644 --- a/modules/pseudoclients/operserv.cpp +++ b/modules/pseudoclients/operserv.cpp @@ -29,8 +29,7 @@ class SGLineManager : public XLineManager void OnExpire(XLine *x) { - if (Config->WallAkillExpire) - ircdproto->SendGlobops(OperServ, "AKILL on %s has expired", x->Mask.c_str()); + Log(OperServ, "expire/akill") << "AKILL on \2" << x->Mask << "\2 has expired"; } void Send(User *u, XLine *x) @@ -86,8 +85,7 @@ class SQLineManager : public XLineManager void OnExpire(XLine *x) { - if (Config->WallSQLineExpire) - ircdproto->SendGlobops(OperServ, "SQLINE on \2%s\2 has expired", x->Mask.c_str()); + Log(OperServ, "expire/sqline") << "SQLINE on \2" << x->Mask << "\2 has expired"; } void Send(User *u, XLine *x) @@ -127,8 +125,7 @@ class SNLineManager : public XLineManager void OnExpire(XLine *x) { - if (Config->WallSNLineExpire) - ircdproto->SendGlobops(OperServ, "SNLINE on \2%s\2 has expired", x->Mask.c_str()); + Log(OperServ, "expire/snline") << "SNLINE on \2" << x->Mask << "\2 has expired"; } void Send(User *u, XLine *x) @@ -206,8 +203,7 @@ class OperServCore : public Module if (Config->OSOpersOnly && !u->HasMode(UMODE_OPER) && bi->nick == Config->OperServ) { u->SendMessage(bi, ACCESS_DENIED); - if (Config->WallBadOS) - ircdproto->SendGlobops(OperServ, "Denied access to %s from %s!%s@%s (non-oper)", Config->OperServ.c_str(), u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str()); + Log(OperServ, "bados") << "Denied access to " << Config->OperServ << " from " << u->GetMask() << " (non-oper)"; return EVENT_STOP; } @@ -217,23 +213,19 @@ class OperServCore : public Module void OnServerQuit(Server *server) { if (server->HasFlag(SERVER_JUPED)) - ircdproto->SendGlobops(OperServ, "Received SQUIT for juped server %s", server->GetName().c_str()); + Log(server, "squit", OperServ) << "Received SQUIT for juped server " << server->GetName(); } void OnUserModeSet(User *u, UserModeName Name) { if (Name == UMODE_OPER) - { - if (Config->WallOper) - ircdproto->SendGlobops(OperServ, "\2%s\2 is now an IRC operator.", u->nick.c_str()); - Log(OperServ) << u->nick << " is now an IRC operator"; - } + Log(u, "oper", OperServ) << "is now an IRC operator."; } void OnUserModeUnset(User *u, UserModeName Name) { if (Name == UMODE_OPER) - Log(OperServ) << u->nick << " is no longer an IRC operator"; + Log(u, "oper", OperServ) << "is no longer an IRC operator"; } void OnUserConnect(dynamic_reference<User> &u, bool &exempt) |
