diff options
-rw-r--r-- | modules/commands/cs_access.cpp | 14 | ||||
-rw-r--r-- | modules/commands/cs_akick.cpp | 13 | ||||
-rw-r--r-- | modules/commands/cs_drop.cpp | 2 | ||||
-rw-r--r-- | modules/commands/ns_set.cpp | 4 | ||||
-rw-r--r-- | modules/commands/ns_suspend.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_forbid.cpp | 4 | ||||
-rw-r--r-- | modules/commands/os_ignore.cpp | 4 | ||||
-rw-r--r-- | modules/commands/os_session.cpp | 10 | ||||
-rw-r--r-- | modules/commands/os_sxline.cpp | 8 | ||||
-rw-r--r-- | modules/pseudoclients/chanserv.cpp | 6 | ||||
-rw-r--r-- | modules/pseudoclients/nickserv.cpp | 4 | ||||
-rw-r--r-- | src/config.cpp | 2 |
12 files changed, 40 insertions, 33 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 91f9cff4f..0ecf95106 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -222,10 +222,11 @@ class CommandCSAccess : public Command Command *c; unsigned deleted; Anope::string Nicks; - bool Denied; + bool denied; bool override; + AccessGroup ag; public: - AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), Denied(false), override(false) + AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), denied(false), override(false), ag(source.AccessFor(ci)) { if (!source.AccessFor(ci).HasPriv("ACCESS_CHANGE") && source.HasPriv("chanserv/access/modify")) this->override = true; @@ -233,7 +234,7 @@ class CommandCSAccess : public Command ~AccessDelCallback() { - if (Denied && !deleted) + if (denied && !deleted) source.Reply(ACCESS_DENIED); else if (!deleted) source.Reply(_("No matching entries on %s access list."), ci->name.c_str()); @@ -255,12 +256,11 @@ class CommandCSAccess : public Command ChanAccess *access = ci->GetAccess(Number - 1); - AccessGroup u_access = source.AccessFor(ci); - const ChanAccess *u_highest = u_access.Highest(); + const ChanAccess *u_highest = ag.Highest(); - if ((!u_highest || *u_highest <= *access) && !u_access.founder && !this->override && !access->mask.equals_ci(source.nc->display)) + if ((!u_highest || *u_highest <= *access) && !ag.founder && !this->override && !access->mask.equals_ci(source.nc->display)) { - Denied = true; + denied = true; return; } diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 17b95e176..a67a5b543 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -187,16 +187,14 @@ class CommandCSAKick : public Command ChannelInfo *ci; Command *c; unsigned deleted; + AccessGroup ag; public: - AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0) + AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), ag(source.AccessFor(ci)) { } ~AkickDelCallback() { - bool override = !source.AccessFor(ci).HasPriv("AKICK"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << deleted << (deleted == 1 ? " entry" : " entries"); - if (!deleted) source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str()); else if (deleted == 1) @@ -210,7 +208,12 @@ class CommandCSAKick : public Command if (!number || number > ci->GetAkickCount()) return; - FOREACH_MOD(OnAkickDel, (source, ci, ci->GetAkick(number - 1))); + const AutoKick *akick = ci->GetAkick(number - 1); + + FOREACH_MOD(OnAkickDel, (source, ci, akick)); + + bool override = !ag.HasPriv("AKICK"); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << (akick->nc ? akick->nc->display : akick->mask); ++deleted; ci->EraseAkick(number - 1); diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 86061dc91..908be11db 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -24,7 +24,7 @@ class CommandCSDrop : public Command { const Anope::string &chan = params[0]; - if (Anope::ReadOnly) + if (Anope::ReadOnly && !source.HasPriv("chanserv/administration")) { source.Reply(_("Sorry, channel de-registration is temporarily disabled.")); // XXX: READ_ONLY_MODE? return; diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp index ae7f10376..6bd6f23ee 100644 --- a/modules/commands/ns_set.cpp +++ b/modules/commands/ns_set.cpp @@ -1087,13 +1087,13 @@ class CommandNSSASetNoexpire : public Command if (param.equals_ci("ON")) { - Log(LOG_ADMIN, source, this) << "to enable noexpire " << na->nc->display; + Log(LOG_ADMIN, source, this) << "to enable noexpire for " << na->nc->display; na->Extend<bool>("NS_NO_EXPIRE"); source.Reply(_("Nick %s \002will not\002 expire."), na->nick.c_str()); } else if (param.equals_ci("OFF")) { - Log(LOG_ADMIN, source, this) << "to disable noexpire " << na->nc->display; + Log(LOG_ADMIN, source, this) << "to disable noexpire for " << na->nc->display; na->Shrink<bool>("NS_NO_EXPIRE"); source.Reply(_("Nick %s \002will\002 expire."), na->nick.c_str()); } diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index ae0d85206..b4aadbdd4 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -245,7 +245,7 @@ class NSSuspend : public Module na->last_seen = Anope::CurTime; suspend.Unset(na->nc); - Log(LOG_NORMAL, "expire", Config->GetClient("NickServ")) << "Expiring suspend for " << na->nick; + Log(LOG_NORMAL, "nickserv/expire", Config->GetClient("NickServ")) << "Expiring suspend for " << na->nick; } } diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 88190ec8d..9dae12ab6 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -73,7 +73,7 @@ class MyForbidService : public ForbidService else if (d->type == FT_EMAIL) ftype = "email"; - Log(LOG_NORMAL, "expire/forbid") << "Expiring forbid for " << d->mask << " type " << ftype; + Log(LOG_NORMAL, "expire/forbid", Config->GetClient("OperServ")) << "Expiring forbid for " << d->mask << " type " << ftype; this->forbids(j).erase(this->forbids(j).begin() + i - 1); delete d; } @@ -174,7 +174,7 @@ class CommandOSForbid : public Command source.Reply(READ_ONLY_MODE); Log(LOG_ADMIN, source, this) << "to add a forbid on " << entry << " of type " << subcommand; - source.Reply(_("Added a forbid on %s to expire on %s."), entry.c_str(), d->expires ? Anope::strftime(d->expires, source.GetAccount()).c_str() : "never"); + source.Reply(_("Added a forbid on %s of type %s to expire on %s."), entry.c_str(), type.c_str(), d->expires ? Anope::strftime(d->expires, source.GetAccount()).c_str() : "never"); /* apply forbid */ switch (ftype) diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index a8564a246..07d05bd36 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -105,7 +105,7 @@ class OSIgnoreService : public IgnoreService if (id.time && id.time <= Anope::CurTime) { - Log(LOG_DEBUG) << "Expiring ignore entry " << id.mask; + Log(LOG_NORMAL, "expire/ignore", Config->GetClient("OperServ")) << "Expiring ignore entry " << id.mask; this->ignores.erase(ign); } else @@ -212,7 +212,7 @@ class CommandOSIgnore : public Command if (id.time && id.time <= Anope::CurTime) { - Log(LOG_DEBUG) << "Expiring ignore entry " << id.mask; + Log(LOG_NORMAL, "expire/ignore", Config->GetClient("OperServ")) << "Expiring ignore entry " << id.mask; ignores.erase(it); } } diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index 8ed2a5889..80eee41f9 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -128,8 +128,9 @@ class ExceptionDelCallback : public NumberList protected: CommandSource &source; unsigned deleted; + Command *cmd; public: - ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist) : NumberList(numlist, true), source(_source), deleted(0) + ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), deleted(0), cmd(c) { } @@ -148,8 +149,9 @@ class ExceptionDelCallback : public NumberList if (!number || number > session_service->GetExceptions().size()) return; - ++deleted; + Log(LOG_ADMIN, source, cmd) << "to remove the session limit exception for " << session_service->GetExceptions()[number - 1]->mask; + ++deleted; DoDel(source, number - 1); } @@ -393,7 +395,7 @@ class CommandOSException : public Command if (isdigit(mask[0]) && mask.find_first_not_of("1234567890,-") == Anope::string::npos) { - ExceptionDelCallback list(source, mask); + ExceptionDelCallback list(source, mask, this); list.Process(); } else @@ -402,7 +404,7 @@ class CommandOSException : public Command for (; i < end; ++i) if (mask.equals_ci(session_service->GetExceptions()[i]->mask)) { - Log(LOG_ADMIN, source, this) << "to remove session limit exception for " << mask; + Log(LOG_ADMIN, source, this) << "to remove the session limit exception for " << mask; ExceptionDelCallback::DoDel(source, i); source.Reply(_("\002%s\002 deleted from session-limit exception list."), mask.c_str()); break; diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 512f48606..bdd481f33 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -25,11 +25,11 @@ class SXLineDelCallback : public NumberList ~SXLineDelCallback() { if (!deleted) - source.Reply(_("No matching entries on the %s list."), this->command->name.c_str()); + source.Reply(_("No matching entries on the %s list."), source.command.c_str()); else if (deleted == 1) - source.Reply(_("Deleted 1 entry from the %s list."), this->command->name.c_str()); + source.Reply(_("Deleted 1 entry from the %s list."), source.command.c_str()); else - source.Reply(_("Deleted %d entries from the %s list."), deleted, this->command->name.c_str()); + source.Reply(_("Deleted %d entries from the %s list."), deleted, source.command.c_str()); } void HandleNumber(unsigned number) anope_override @@ -42,6 +42,8 @@ class SXLineDelCallback : public NumberList if (!x) return; + Log(LOG_ADMIN, source, command) << "to remove " << x->mask << " from the list"; + ++deleted; DoDel(this->xlm, source, x); } diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index d4b98625a..9f8cdc52e 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -162,13 +162,13 @@ class ChanServCore : public Module, public ChanServService if (newowner) { - Log(LOG_NORMAL, "chanserv/expire") << "Transferring foundership of " << ci->name << " from deleted nick " << nc->display << " to " << newowner->display; + Log(LOG_NORMAL, "chanserv/drop", ChanServ) << "Transferring foundership of " << ci->name << " from deleted nick " << nc->display << " to " << newowner->display; ci->SetFounder(newowner); ci->SetSuccessor(NULL); } else { - Log(LOG_NORMAL, "chanserv/expire") << "Deleting channel " << ci->name << " owned by deleted nick " << nc->display; + Log(LOG_NORMAL, "chanserv/drop", ChanServ) << "Deleting channel " << ci->name << " owned by deleted nick " << nc->display; delete ci; continue; @@ -365,7 +365,7 @@ class ChanServCore : public Module, public ChanServService if (expire) { - Log(LOG_NORMAL, "chanserv/expire") << "Expiring channel " << ci->name << " (founder: " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << ")"; + Log(LOG_NORMAL, "chanserv/expire", ChanServ) << "Expiring channel " << ci->name << " (founder: " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << ")"; FOREACH_MOD(OnChanExpire, (ci)); delete ci; } diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index 3a6192244..ee5c96fb1 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -287,7 +287,7 @@ class NickServCore : public Module, public NickServService void OnDelCore(NickCore *nc) anope_override { - Log(NickServ, "nick") << "deleting nickname group " << nc->display; + Log(NickServ, "nick") << "Deleting nickname group " << nc->display; /* Clean up this nick core from any users online */ for (std::list<User *>::iterator it = nc->users.begin(); it != nc->users.end();) @@ -509,7 +509,7 @@ class NickServCore : public Module, public NickServService if (expire) { - Log(LOG_NORMAL, "expire") << "Expiring nickname " << na->nick << " (group: " << na->nc->display << ") (e-mail: " << (na->nc->email.empty() ? "none" : na->nc->email) << ")"; + Log(LOG_NORMAL, "nickserv/expire", NickServ) << "Expiring nickname " << na->nick << " (group: " << na->nc->display << ") (e-mail: " << (na->nc->email.empty() ? "none" : na->nc->email) << ")"; FOREACH_MOD(OnNickExpire, (na)); delete na; } diff --git a/src/config.cpp b/src/config.cpp index 27c3eccdc..40bfc0613 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -420,7 +420,7 @@ Conf::Conf() : Block("") spacesepstream(log->Get<const Anope::string>("servers")).GetTokens(l.servers); spacesepstream(log->Get<const Anope::string>("channels")).GetTokens(l.channels); spacesepstream(log->Get<const Anope::string>("users")).GetTokens(l.users); - spacesepstream(log->Get<const Anope::string>("normal")).GetTokens(l.normal); + spacesepstream(log->Get<const Anope::string>("other")).GetTokens(l.normal); this->LogInfos.push_back(l); } |