diff options
author | phil-lavin <phil-lavin@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-05-12 18:13:34 +0000 |
---|---|---|
committer | phil-lavin <phil-lavin@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-05-12 18:13:34 +0000 |
commit | d049bf0d8f0f0e219a22e3dd1d2ad72fd85f1a08 (patch) | |
tree | 77bff603160d74237fb662c7e2023993cd887e0e | |
parent | a53cbd82cc2499c4d0f7e84ec50e6b07a7cca2c7 (diff) |
Added a tonne of alog()s to log all stateful commands
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2952 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | src/core/bs_assign.c | 2 | ||||
-rw-r--r-- | src/core/bs_badwords.c | 12 | ||||
-rw-r--r-- | src/core/bs_kick.c | 88 | ||||
-rw-r--r-- | src/core/bs_set.c | 28 | ||||
-rw-r--r-- | src/core/bs_unassign.c | 2 | ||||
-rw-r--r-- | src/core/cs_akick.c | 15 | ||||
-rw-r--r-- | src/core/cs_clear.c | 19 | ||||
-rw-r--r-- | src/core/cs_getkey.c | 2 | ||||
-rw-r--r-- | src/core/cs_set.c | 64 | ||||
-rw-r--r-- | src/core/hs_group.c | 2 | ||||
-rw-r--r-- | src/core/ms_sendall.c | 2 | ||||
-rw-r--r-- | src/core/ms_set.c | 42 | ||||
-rw-r--r-- | src/core/ns_access.c | 5 | ||||
-rw-r--r-- | src/core/ns_ghost.c | 5 | ||||
-rw-r--r-- | src/core/ns_recover.c | 5 | ||||
-rw-r--r-- | src/core/ns_saset.c | 58 | ||||
-rw-r--r-- | src/core/ns_set.c | 54 | ||||
-rw-r--r-- | src/messages.c | 4 | ||||
-rw-r--r-- | version.log | 1 |
20 files changed, 376 insertions, 35 deletions
@@ -2,6 +2,7 @@ Anope Version 1.8 - SVN ----------------------- 5/5 A Added an internal event called when a nick is requested [ #00] 5/9 A Added an Atheme to Anope database converter [ #00] +5/12 A Added logging for stateful commands [ #00] 4/15 F Fixed os_info to backup its database on Windows [ #00] 4/15 F Fixed a potential crash in cs_clear ops [#1154] 4/16 F Fixed missing TS6SID on FJOIN in inspircd12 [ #00] diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c index 05b247802..3d94c89f1 100644 --- a/src/core/bs_assign.c +++ b/src/core/bs_assign.c @@ -95,6 +95,8 @@ int do_assign(User * u) if (ci->c && ci->c->usercount >= BSMinUsers) { bot_join(ci); } + alog("%s: %s!%s@%s assigned bot %s to %s", s_BotServ, u->nick, u->username, + u->host, bi->nick, ci->name); notice_lang(s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick, ci->name); send_event(EVENT_BOT_ASSIGN, 2, ci->name, bi->nick); } diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c index 3a0d8963f..5f9eb29a7 100644 --- a/src/core/bs_badwords.c +++ b/src/core/bs_badwords.c @@ -143,7 +143,9 @@ int do_badwords(User * u) bw->in_use = 1; bw->word = sstrdup(word); bw->type = type; - + + alog("%s: %s!%s@%s added badword \"%s\" to %s", + s_BotServ, u->nick, u->username, u->host, bw->word, ci->name); notice_lang(s_BotServ, u, BOT_BADWORDS_ADDED, bw->word, ci->name); } else if (stricmp(cmd, "DEL") == 0) { @@ -169,9 +171,13 @@ int do_badwords(User * u) ci->name); } } else if (deleted == 1) { + alog("%s: %s!%s@%s deleted 1 badword from %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name); } else { + alog("%s: %s!%s@%s deleted %d badwords from %s", + s_BotServ, u->nick, u->username, u->host, deleted, ci->name); notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, deleted, ci->name); } @@ -187,6 +193,8 @@ int do_badwords(User * u) return MOD_CONT; } bw = &ci->badwords[i]; + alog("%s: %s!%s@%s deleted badword \"%s\" from %s", + s_BotServ, u->nick, u->username, u->host, bw->word, ci->name); notice_lang(s_BotServ, u, BOT_BADWORDS_DELETED, bw->word, ci->name); if (bw->word) @@ -266,6 +274,8 @@ int do_badwords(User * u) ci->badwords = NULL; ci->bwcount = 0; + alog("%s: %s!%s@%s cleared badwords on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_BADWORDS_CLEAR); } else { diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c index b45f86941..9d7d2c21e 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -136,13 +136,20 @@ int do_kickcmd(User * u) ci->ttb[TTB_BADWORDS] = 0; } ci->botflags |= BS_KICK_BADWORDS; - if (ci->ttb[TTB_BADWORDS]) + if (ci->ttb[TTB_BADWORDS]) { + alog("%s: %s!%s@%s enabled kicking for badwords on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_BADWORDS]); notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for badwords on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_ON); + } } else { ci->botflags &= ~BS_KICK_BADWORDS; + alog("%s: %s!%s@%s disabled kicking for badwords on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_BADWORDS_OFF); } } else if (!stricmp(option, "BOLDS")) { @@ -162,13 +169,20 @@ int do_kickcmd(User * u) } else ci->ttb[TTB_BOLDS] = 0; ci->botflags |= BS_KICK_BOLDS; - if (ci->ttb[TTB_BOLDS]) + if (ci->ttb[TTB_BOLDS]) { + alog("%s: %s!%s@%s enabled kicking for bolds on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_BOLDS]); notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for bolds on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_BOLDS_ON); + } } else { ci->botflags &= ~BS_KICK_BOLDS; + alog("%s: %s!%s@%s disabled kicking for bolds on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_BOLDS_OFF); } } else if (!stricmp(option, "CAPS")) { @@ -206,14 +220,21 @@ int do_kickcmd(User * u) ci->capspercent = 25; ci->botflags |= BS_KICK_CAPS; - if (ci->ttb[TTB_CAPS]) + if (ci->ttb[TTB_CAPS]) { + alog("%s: %s!%s@%s enabled kicking for caps on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_CAPS]); notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for caps on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent); + } } else { + alog("%s: %s!%s@%s disabled kicking for caps on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); ci->botflags &= ~BS_KICK_CAPS; notice_lang(s_BotServ, u, BOT_KICK_CAPS_OFF); } @@ -234,12 +255,19 @@ int do_kickcmd(User * u) } else ci->ttb[TTB_COLORS] = 0; ci->botflags |= BS_KICK_COLORS; - if (ci->ttb[TTB_COLORS]) + if (ci->ttb[TTB_COLORS]) { + alog("%s: %s!%s@%s enabled kicking for colors on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_COLORS]); notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for colors on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_COLORS_ON); + } } else { + alog("%s: %s!%s@%s disabled kicking for colors on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); ci->botflags &= ~BS_KICK_COLORS; notice_lang(s_BotServ, u, BOT_KICK_COLORS_OFF); } @@ -278,15 +306,22 @@ int do_kickcmd(User * u) ci->floodsecs = 10; ci->botflags |= BS_KICK_FLOOD; - if (ci->ttb[TTB_FLOOD]) + if (ci->ttb[TTB_FLOOD]) { + alog("%s: %s!%s@%s enabled kicking for flood on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_FLOOD]); notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for flood on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs); + } } else { ci->botflags &= ~BS_KICK_FLOOD; + alog("%s: %s!%s@%s disabled kicking for flood on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_FLOOD_OFF); } } else if (!stricmp(option, "REPEAT")) { @@ -316,14 +351,21 @@ int do_kickcmd(User * u) ci->repeattimes = 3; ci->botflags |= BS_KICK_REPEAT; - if (ci->ttb[TTB_REPEAT]) + if (ci->ttb[TTB_REPEAT]) { + alog("%s: %s!%s@%s enabled kicking for repeating on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_REPEAT]); notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for repeating on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_REPEAT_ON, ci->repeattimes); + } } else { ci->botflags &= ~BS_KICK_REPEAT; + alog("%s: %s!%s@%s disabled kicking for repeating on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_REPEAT_OFF); } } else if (!stricmp(option, "REVERSES")) { @@ -344,13 +386,20 @@ int do_kickcmd(User * u) } else ci->ttb[TTB_REVERSES] = 0; ci->botflags |= BS_KICK_REVERSES; - if (ci->ttb[TTB_REVERSES]) + if (ci->ttb[TTB_REVERSES]) { + alog("%s: %s!%s@%s enabled kicking for reversess on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_REVERSES]); notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for reverses on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_REVERSES_ON); + } } else { ci->botflags &= ~BS_KICK_REVERSES; + alog("%s: %s!%s@%s disabled kicking for reverses on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_REVERSES_OFF); } } else if (!stricmp(option, "UNDERLINES")) { @@ -371,13 +420,20 @@ int do_kickcmd(User * u) } else ci->ttb[TTB_UNDERLINES] = 0; ci->botflags |= BS_KICK_UNDERLINES; - if (ci->ttb[TTB_UNDERLINES]) + if (ci->ttb[TTB_UNDERLINES]) { + alog("%s: %s!%s@%s enabled kicking for underlines on %s with time to ban of %d", + s_BotServ, u->nick, u->username, u->host, ci->name, ci->ttb[TTB_UNDERLINES]); notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]); - else + } else { + alog("%s: %s!%s@%s enabled kicking for underlines on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_ON); + } } else { ci->botflags &= ~BS_KICK_UNDERLINES; + alog("%s: %s!%s@%s disabled kicking for underlines on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_KICK_UNDERLINES_OFF); } } else diff --git a/src/core/bs_set.c b/src/core/bs_set.c index b71765184..169f5b424 100644 --- a/src/core/bs_set.c +++ b/src/core/bs_set.c @@ -109,9 +109,13 @@ int do_set(User * u) if ((bi = findbot(chan))) { if (!stricmp(value, "ON")) { bi->flags |= BI_PRIVATE; + alog("%s: %s!%s@%s set PRIVATE on bot %s", + s_BotServ, u->nick, u->username, u->host, bi->nick); notice_lang(s_BotServ, u, BOT_SET_PRIVATE_ON, bi->nick); } else if (!stricmp(value, "OFF")) { bi->flags &= ~BI_PRIVATE; + alog("%s: %s!%s@%s unset PRIVATE on bot %s", + s_BotServ, u->nick, u->username, u->host, bi->nick); notice_lang(s_BotServ, u, BOT_SET_PRIVATE_OFF, bi->nick); } else { syntax_error(s_BotServ, u, "SET PRIVATE", @@ -131,10 +135,14 @@ int do_set(User * u) if (!stricmp(option, "DONTKICKOPS")) { if (!stricmp(value, "ON")) { ci->botflags |= BS_DONTKICKOPS; + alog("%s: %s!%s@%s set DONTKICKOPS on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_ON, ci->name); } else if (!stricmp(value, "OFF")) { ci->botflags &= ~BS_DONTKICKOPS; + alog("%s: %s!%s@%s unset DONTKICKOPS on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_DONTKICKOPS_OFF, ci->name); } else { @@ -144,10 +152,14 @@ int do_set(User * u) } else if (!stricmp(option, "DONTKICKVOICES")) { if (!stricmp(value, "ON")) { ci->botflags |= BS_DONTKICKVOICES; + alog("%s: %s!%s@%s set DONTKICKVOICES on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_ON, ci->name); } else if (!stricmp(value, "OFF")) { ci->botflags &= ~BS_DONTKICKVOICES; + alog("%s: %s!%s@%s unset DONTKICKVOICES on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF, ci->name); } else { @@ -157,9 +169,13 @@ int do_set(User * u) } else if (!stricmp(option, "FANTASY")) { if (!stricmp(value, "ON")) { ci->botflags |= BS_FANTASY; + alog("%s: %s!%s@%s set FANTASY on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_FANTASY_ON, ci->name); } else if (!stricmp(value, "OFF")) { ci->botflags &= ~BS_FANTASY; + alog("%s: %s!%s@%s unset FANTASY on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name); } else { syntax_error(s_BotServ, u, "SET FANTASY", @@ -168,9 +184,13 @@ int do_set(User * u) } else if (!stricmp(option, "GREET")) { if (!stricmp(value, "ON")) { ci->botflags |= BS_GREET; + alog("%s: %s!%s@%s set GREET on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_GREET_ON, ci->name); } else if (!stricmp(value, "OFF")) { ci->botflags &= ~BS_GREET; + alog("%s: %s!%s@%s unset GREET on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_GREET_OFF, ci->name); } else { syntax_error(s_BotServ, u, "SET GREET", @@ -181,9 +201,13 @@ int do_set(User * u) ci->botflags |= BS_NOBOT; if (ci->bi) unassign(u, ci); + alog("%s: %s!%s@%s set NOBOT on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_NOBOT_ON, ci->name); } else if (!stricmp(value, "OFF")) { ci->botflags &= ~BS_NOBOT; + alog("%s: %s!%s@%s unset NOBOT on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name); } else { syntax_error(s_BotServ, u, "SET NOBOT", @@ -192,9 +216,13 @@ int do_set(User * u) } else if (!stricmp(option, "SYMBIOSIS")) { if (!stricmp(value, "ON")) { ci->botflags |= BS_SYMBIOSIS; + alog("%s: %s!%s@%s set SYMBIOSIS on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name); } else if (!stricmp(value, "OFF")) { ci->botflags &= ~BS_SYMBIOSIS; + alog("%s: %s!%s@%s unset SYMBIOSIS on %s", + s_BotServ, u->nick, u->username, u->host, ci->name); notice_lang(s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name); } else { syntax_error(s_BotServ, u, "SET SYMBIOSIS", diff --git a/src/core/bs_unassign.c b/src/core/bs_unassign.c index da2fd6f7d..11d1a90ef 100644 --- a/src/core/bs_unassign.c +++ b/src/core/bs_unassign.c @@ -82,6 +82,8 @@ int do_unassign(User * u) else if (!ci->bi) notice_help(s_BotServ, u, BOT_NOT_ASSIGNED); else { + alog("%s: %s!%s@%s unassigned bot %s from %s", s_BotServ, u->nick, u->username, + u->host, ci->bi->nick, ci->name); unassign(u, ci); notice_lang(s_BotServ, u, BOT_UNASSIGN_UNASSIGNED, ci->name); } diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index 167bc8651..44511a7c1 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -357,6 +357,8 @@ int do_akick(User * u) cu = next; } } + alog("%s: %s!%s@%s added akick for %s to %s", + s_ChanServ, u->nick, u->username, u->host, mask, chan); notice_lang(s_ChanServ, u, CHAN_AKICK_ADDED, mask, chan); if (count) @@ -397,6 +399,8 @@ int do_akick(User * u) } akick->flags |= AK_STUCK; + alog("%s: %s!%s@%s set STICK on akick %s on %s", + s_ChanServ, u->nick, u->username, u->host, akick->u.mask, ci->name); notice_lang(s_ChanServ, u, CHAN_AKICK_STUCK, akick->u.mask, ci->name); @@ -433,6 +437,8 @@ int do_akick(User * u) } akick->flags &= ~AK_STUCK; + alog("%s: %s!%s@%s unset STICK on akick %s on %s", + s_ChanServ, u->nick, u->username, u->host, akick->u.mask, ci->name); notice_lang(s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->u.mask, ci->name); @@ -463,9 +469,14 @@ int do_akick(User * u) ci->name); } } else if (deleted == 1) { + alog("%s: %s!%s@%s deleted 1 akick on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_AKICK_DELETED_ONE, ci->name); } else { + alog("%s: %s!%s@%s deleted %d akicks on %s", + s_ChanServ, u->nick, u->username, u->host, deleted, + ci->name); notice_lang(s_ChanServ, u, CHAN_AKICK_DELETED_SEVERAL, deleted, ci->name); } @@ -487,6 +498,8 @@ int do_akick(User * u) chan); return MOD_CONT; } + alog("%s: %s!%s@%s deleted akick %s on %s", + s_ChanServ, u->nick, u->username, u->host, mask, chan); notice_lang(s_ChanServ, u, CHAN_AKICK_DELETED, mask, chan); akick_del(u, akick); deleted = 1; @@ -645,6 +658,8 @@ int do_akick(User * u) ci->akick = NULL; ci->akickcount = 0; + alog("%s: %s!%s@%s cleared akicks on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_AKICK_CLEAR, ci->name); } else { diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c index 70f01729d..efaba0e5f 100644 --- a/src/core/cs_clear.c +++ b/src/core/cs_clear.c @@ -98,6 +98,8 @@ int do_clear(User * u) } } + alog("%s: %s!%s@%s cleared bans on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_BANS, chan); } else if (ircd->except && stricmp(what, "excepts") == 0) { char *av[2]; @@ -114,8 +116,10 @@ int do_clear(User * u) free(av[1]); } } - notice_lang(s_ChanServ, u, CHAN_CLEARED_EXCEPTS, chan); + alog("%s: %s!%s@%s cleared excepts on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); + notice_lang(s_ChanServ, u, CHAN_CLEARED_EXCEPTS, chan); } else if (ircd->invitemode && stricmp(what, "invites") == 0) { char *av[2]; Entry *invite, *next; @@ -131,6 +135,8 @@ int do_clear(User * u) free(av[1]); } } + alog("%s: %s!%s@%s cleared invites on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_INVITES, chan); } else if (stricmp(what, "modes") == 0) { @@ -178,6 +184,8 @@ int do_clear(User * u) check_modes(c); } + alog("%s: %s!%s@%s cleared modes on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_MODES, chan); } else if (stricmp(what, "ops") == 0) { char *av[6]; /* The max we have to hold: chan, ts, modes(max3), nick, nick, nick */ @@ -236,6 +244,9 @@ int do_clear(User * u) do_cmode(s_ChanServ, ac, av); } } + + alog("%s: %s!%s@%s cleared ops on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_OPS, chan); } else if (ircd->halfop && stricmp(what, "hops") == 0) { char *av[4]; @@ -285,6 +296,8 @@ int do_clear(User * u) } } } + alog("%s: %s!%s@%s cleared halfops on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_HOPS, chan); } else if (stricmp(what, "voices") == 0) { char *av[4]; @@ -335,6 +348,8 @@ int do_clear(User * u) } } } + alog("%s: %s!%s@%s cleared voices on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_VOICES, chan); } else if (stricmp(what, "users") == 0) { char *av[3]; @@ -354,6 +369,8 @@ int do_clear(User * u) free(av[1]); free(av[0]); } + alog("%s: %s!%s@%s cleared users on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_CLEARED_USERS, chan); } else { syntax_error(s_ChanServ, u, "CLEAR", CHAN_CLEAR_SYNTAX); diff --git a/src/core/cs_getkey.c b/src/core/cs_getkey.c index 8caf09ba3..a86c0a445 100644 --- a/src/core/cs_getkey.c +++ b/src/core/cs_getkey.c @@ -81,6 +81,8 @@ int do_getkey(User * u) } else if (!ci->c || !ci->c->key) { notice_lang(s_ChanServ, u, CHAN_GETKEY_NOKEY, chan); } else { + alog("%s: %s!%s@%s used GETKEY on %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_GETKEY_KEY, chan, ci->c->key); } diff --git a/src/core/cs_set.c b/src/core/cs_set.c index f29176b3f..01297eff4 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -412,6 +412,8 @@ int do_set_desc(User * u, ChannelInfo * ci, char *param) if (ci->desc) free(ci->desc); ci->desc = sstrdup(param); + alog("%s: %s!%s@%s set description of %s to: %s", + s_ChanServ, u->nick, u->username, u->host, ci->name, ci->desc); notice_lang(s_ChanServ, u, CHAN_DESC_CHANGED, ci->name, param); return MOD_CONT; } @@ -424,9 +426,13 @@ int do_set_url(User * u, ChannelInfo * ci, char *param) free(ci->url); if (param) { ci->url = sstrdup(param); + alog("%s: %s!%s@%s set url for %s to: %s", + s_ChanServ, u->nick, u->username, u->host, ci->name, ci->url); notice_lang(s_ChanServ, u, CHAN_URL_CHANGED, ci->name, param); } else { ci->url = NULL; + alog("%s: %s!%s@%s unset url for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_URL_UNSET, ci->name); } return MOD_CONT; @@ -440,9 +446,13 @@ int do_set_email(User * u, ChannelInfo * ci, char *param) free(ci->email); if (param) { ci->email = sstrdup(param); + alog("%s: %s!%s@%s set email for %s to: %s", + s_ChanServ, u->nick, u->username, u->host, ci->name, ci->email); notice_lang(s_ChanServ, u, CHAN_EMAIL_CHANGED, ci->name, param); } else { ci->email = NULL; + alog("%s: %s!%s@%s unset email for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_EMAIL_UNSET, ci->name); } return MOD_CONT; @@ -456,10 +466,14 @@ int do_set_entrymsg(User * u, ChannelInfo * ci, char *param) free(ci->entry_message); if (param) { ci->entry_message = sstrdup(param); + alog("%s: %s!%s@%s set entrymsg for %s to: %s", + s_ChanServ, u->nick, u->username, u->host, ci->name, ci->entry_message); notice_lang(s_ChanServ, u, CHAN_ENTRY_MSG_CHANGED, ci->name, param); } else { ci->entry_message = NULL; + alog("%s: %s!%s@%s unset entrymsg for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_ENTRY_MSG_UNSET, ci->name); } return MOD_CONT; @@ -553,6 +567,8 @@ int do_set_mlock(User * u, ChannelInfo * ci, char *param) * mode lock at all. */ if (get_mlock_modes(ci, 0)) { + alog("%s: %s!%s@%s set mlock for %s to: %s", + s_ChanServ, u->nick, u->username, u->host, ci->name, get_mlock_modes(ci, 0)); notice_lang(s_ChanServ, u, CHAN_MLOCK_CHANGED, ci->name, get_mlock_modes(ci, 0)); } @@ -575,6 +591,8 @@ int do_set_bantype(User * u, ChannelInfo * ci, char *param) notice_lang(s_ChanServ, u, CHAN_SET_BANTYPE_INVALID, param); } else { ci->bantype = bantype; + alog("%s: %s!%s@%s set ban type for %s to: %s", + s_ChanServ, u->nick, u->username, u->host, ci->name, ci->bantype); notice_lang(s_ChanServ, u, CHAN_SET_BANTYPE_CHANGED, ci->name, ci->bantype); } @@ -587,9 +605,13 @@ int do_set_keeptopic(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_KEEPTOPIC; + alog("%s: %s!%s@%s set keeptopic ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_KEEPTOPIC_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_KEEPTOPIC; + alog("%s: %s!%s@%s set keeptopic OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_KEEPTOPIC_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET KEEPTOPIC", @@ -604,9 +626,13 @@ int do_set_topiclock(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_TOPICLOCK; + alog("%s: %s!%s@%s set topiclock ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_TOPICLOCK_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_TOPICLOCK; + alog("%s: %s!%s@%s set topiclock OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_TOPICLOCK_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET TOPICLOCK", @@ -621,9 +647,13 @@ int do_set_private(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_PRIVATE; + alog("%s: %s!%s@%s set private ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_PRIVATE_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_PRIVATE; + alog("%s: %s!%s@%s set private OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_PRIVATE_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET PRIVATE", @@ -638,9 +668,13 @@ int do_set_secureops(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_SECUREOPS; + alog("%s: %s!%s@%s set secureops ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SECUREOPS_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_SECUREOPS; + alog("%s: %s!%s@%s set secureops OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SECUREOPS_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET SECUREOPS", @@ -655,9 +689,13 @@ int do_set_securefounder(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_SECUREFOUNDER; + alog("%s: %s!%s@%s set securefounder ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SECUREFOUNDER_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_SECUREFOUNDER; + alog("%s: %s!%s@%s set securefounder OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SECUREFOUNDER_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET SECUREFOUNDER", @@ -674,11 +712,15 @@ int do_set_restricted(User * u, ChannelInfo * ci, char *param) ci->flags |= CI_RESTRICTED; if (ci->levels[CA_NOJOIN] < 0) ci->levels[CA_NOJOIN] = 0; + alog("%s: %s!%s@%s set restricted ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_RESTRICTED_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_RESTRICTED; if (ci->levels[CA_NOJOIN] >= 0) ci->levels[CA_NOJOIN] = -2; + alog("%s: %s!%s@%s set restricted OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_RESTRICTED_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET RESTRICTED", @@ -693,9 +735,13 @@ int do_set_secure(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_SECURE; + alog("%s: %s!%s@%s set secure ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SECURE_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_SECURE; + alog("%s: %s!%s@%s set secure OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SECURE_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET SECURE", CHAN_SET_SECURE_SYNTAX); @@ -710,13 +756,19 @@ int do_set_signkick(User * u, ChannelInfo * ci, char *param) if (stricmp(param, "ON") == 0) { ci->flags |= CI_SIGNKICK; ci->flags &= ~CI_SIGNKICK_LEVEL; + alog("%s: %s!%s@%s set signkick ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SIGNKICK_ON, ci->name); } else if (stricmp(param, "LEVEL") == 0) { ci->flags |= CI_SIGNKICK_LEVEL; ci->flags &= ~CI_SIGNKICK; + alog("%s: %s!%s@%s set signkick LEVEL for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SIGNKICK_LEVEL, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~(CI_SIGNKICK | CI_SIGNKICK_LEVEL); + alog("%s: %s!%s@%s set signkick OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_SIGNKICK_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET SIGNKICK", @@ -731,9 +783,13 @@ int do_set_opnotice(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_OPNOTICE; + alog("%s: %s!%s@%s set opnotice ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_OPNOTICE_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_OPNOTICE; + alog("%s: %s!%s@%s set opnotice OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_OPNOTICE_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET OPNOTICE", @@ -805,9 +861,13 @@ int do_set_peace(User * u, ChannelInfo * ci, char *param) { if (stricmp(param, "ON") == 0) { ci->flags |= CI_PEACE; + alog("%s: %s!%s@%s set peace ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_PEACE_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_PEACE; + alog("%s: %s!%s@%s set peace OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_PEACE_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET PEACE", CHAN_SET_PEACE_SYNTAX); @@ -825,9 +885,13 @@ int do_set_noexpire(User * u, ChannelInfo * ci, char *param) } if (stricmp(param, "ON") == 0) { ci->flags |= CI_NO_EXPIRE; + alog("%s: %s!%s@%s set noexpire ON for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_NOEXPIRE_ON, ci->name); } else if (stricmp(param, "OFF") == 0) { ci->flags &= ~CI_NO_EXPIRE; + alog("%s: %s!%s@%s set noexpire OFF for %s", + s_ChanServ, u->nick, u->username, u->host, ci->name); notice_lang(s_ChanServ, u, CHAN_SET_NOEXPIRE_OFF, ci->name); } else { syntax_error(s_ChanServ, u, "SET NOEXPIRE", diff --git a/src/core/hs_group.c b/src/core/hs_group.c index b753d6d15..ad7be4dad 100644 --- a/src/core/hs_group.c +++ b/src/core/hs_group.c @@ -106,6 +106,8 @@ int do_group(User * u) notice_lang(s_HostServ, u, HOST_GROUP, na->nc->display, vHost); } + alog("%s: %s!%s@%s grouped their vhost", + s_HostServ, u->nick, u->username, u->host); free(vHost); if (vIdent) free(vIdent); diff --git a/src/core/ms_sendall.c b/src/core/ms_sendall.c index a265459a4..2bef520f4 100644 --- a/src/core/ms_sendall.c +++ b/src/core/ms_sendall.c @@ -91,6 +91,8 @@ int do_sendall(User * u) } /* /nc */ } /* /i */ + alog("%s: %s!%s@%s sent a mass memo", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_MASS_SENT); return MOD_CONT; } diff --git a/src/core/ms_set.c b/src/core/ms_set.c index c6914c064..a19581a07 100644 --- a/src/core/ms_set.c +++ b/src/core/ms_set.c @@ -112,27 +112,39 @@ int do_set_notify(User * u, MemoInfo * mi, char *param) { if (stricmp(param, "ON") == 0) { u->na->nc->flags |= NI_MEMO_SIGNON | NI_MEMO_RECEIVE; + alog("%s: %s!%s@%s set notify to ON", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_ON, s_MemoServ); } else if (stricmp(param, "LOGON") == 0) { u->na->nc->flags |= NI_MEMO_SIGNON; u->na->nc->flags &= ~NI_MEMO_RECEIVE; + alog("%s: %s!%s@%s set notify to LOGON", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_LOGON, s_MemoServ); } else if (stricmp(param, "NEW") == 0) { u->na->nc->flags &= ~NI_MEMO_SIGNON; u->na->nc->flags |= NI_MEMO_RECEIVE; + alog("%s: %s!%s@%s set notify to NEW", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NEW, s_MemoServ); } else if (stricmp(param, "MAIL") == 0) { if (u->na->nc->email) { u->na->nc->flags |= NI_MEMO_MAIL; + alog("%s: %s!%s@%s set notify to MAIL", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_MAIL); } else { notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_INVALIDMAIL); } } else if (stricmp(param, "NOMAIL") == 0) { u->na->nc->flags &= ~NI_MEMO_MAIL; + alog("%s: %s!%s@%s set notify to NOMAIL", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_NOMAIL); } else if (stricmp(param, "OFF") == 0) { u->na->nc->flags &= ~(NI_MEMO_SIGNON | NI_MEMO_RECEIVE | NI_MEMO_MAIL); + alog("%s: %s!%s@%s set notify to OFF", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_NOTIFY_OFF, s_MemoServ); } else { syntax_error(s_MemoServ, u, "SET NOTIFY", MEMO_SET_NOTIFY_SYNTAX); @@ -244,23 +256,41 @@ int do_set_limit(User * u, MemoInfo * mi, char *param) } mi->memomax = limit; if (limit > 0) { - if (!chan && na->nc == u->na->nc) + if (!chan && na->nc == u->na->nc) { + alog("%s: %s!%s@%s set their memo limit to %d", + s_MemoServ, u->nick, u->username, u->host, limit); notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT, limit); - else + } else { + alog("%s: %s!%s@%s set the memo limit for %s to %d", + s_MemoServ, u->nick, u->username, u->host, + chan ? chan : user, limit); notice_lang(s_MemoServ, u, MEMO_SET_LIMIT, chan ? chan : user, limit); + } } else if (limit == 0) { - if (!chan && na->nc == u->na->nc) + if (!chan && na->nc == u->na->nc) { + alog("%s: %s!%s@%s set their memo limit to 0", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_SET_YOUR_LIMIT_ZERO); - else + } else { + alog("%s: %s!%s@%s set the memo limit for %s to 0", + s_MemoServ, u->nick, u->username, u->host, + chan ? chan : user); notice_lang(s_MemoServ, u, MEMO_SET_LIMIT_ZERO, chan ? chan : user); + } } else { - if (!chan && na->nc == u->na->nc) + if (!chan && na->nc == u->na->nc) { + alog("%s: %s!%s@%s unset their memo limit", + s_MemoServ, u->nick, u->username, u->host); notice_lang(s_MemoServ, u, MEMO_UNSET_YOUR_LIMIT); - else + } else { + alog("%s: %s!%s@%s unset the memo limit for %s", + s_MemoServ, u->nick, u->username, u->host, + chan ? chan : user); notice_lang(s_MemoServ, u, MEMO_UNSET_LIMIT, chan ? chan : user); + } } return MOD_CONT; } diff --git a/src/core/ns_access.c b/src/core/ns_access.c index b76a85dd6..25296cf8b 100644 --- a/src/core/ns_access.c +++ b/src/core/ns_access.c @@ -140,6 +140,8 @@ int do_access(User * u) na->nc->access = srealloc(na->nc->access, sizeof(char *) * na->nc->accesscount); na->nc->access[na->nc->accesscount - 1] = sstrdup(mask); + alog("%s: %s!%s@%s added %s to their access list", + s_NickServ, u->nick, u->username, u->host, mask); notice_lang(s_NickServ, u, NICK_ACCESS_ADDED, mask); } else if (stricmp(cmd, "DEL") == 0) { @@ -153,7 +155,8 @@ int do_access(User * u) notice_lang(s_NickServ, u, NICK_ACCESS_NOT_FOUND, mask); return MOD_CONT; } - + alog("%s: %s!%s@%s deleted %s from their access list", + s_NickServ, u->nick, u->username, u->host, mask); notice_lang(s_NickServ, u, NICK_ACCESS_DELETED, *access); free(*access); na->nc->accesscount--; diff --git a/src/core/ns_ghost.c b/src/core/ns_ghost.c index 0c8f14b56..e6e90e443 100644 --- a/src/core/ns_ghost.c +++ b/src/core/ns_ghost.c @@ -91,6 +91,8 @@ int do_ghost(User * u) snprintf(buf, sizeof(buf), "GHOST command used by %s", u->nick); + alog("%s: %s!%s@%s used GHOST on %s", + s_NickServ, u->nick, u->username, u->host, u2->nick); kill_user(s_NickServ, nick, buf); notice_lang(s_NickServ, u, NICK_GHOST_KILLED, nick); } else { @@ -108,11 +110,14 @@ int do_ghost(User * u) snprintf(buf, sizeof(buf), "GHOST command used by %s", u->nick); + alog("%s: %s!%s@%s used GHOST on %s", + s_NickServ, u->nick, u->username, u->host, u2->nick); kill_user(s_NickServ, nick, buf); notice_lang(s_NickServ, u, NICK_GHOST_KILLED, nick); } else { notice_lang(s_NickServ, u, ACCESS_DENIED); } } + return MOD_CONT; } diff --git a/src/core/ns_recover.c b/src/core/ns_recover.c index 96980c0a6..26d14405f 100644 --- a/src/core/ns_recover.c +++ b/src/core/ns_recover.c @@ -106,6 +106,8 @@ int do_recover(User * u) if (res == 1) { char relstr[192]; + alog("%s: %s!%s@%s used RECOVER on %s", + s_NickServ, u->nick, u->username, u->host, u2->nick); notice_lang(s_NickServ, u2, FORCENICKCHANGE_NOW); collide(na, 0); @@ -126,6 +128,8 @@ int do_recover(User * u) || (!(na->nc->flags & NI_SECURE) && is_on_access(u, na->nc))) { char relstr[192]; + alog("%s: %s!%s@%s used RECOVER on %s", + s_NickServ, u->nick, u->username, u->host, u2->nick); notice_lang(s_NickServ, u2, FORCENICKCHANGE_NOW); collide(na, 0); @@ -137,6 +141,7 @@ int do_recover(User * u) notice_lang(s_NickServ, u, ACCESS_DENIED); } } + return MOD_CONT; } diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c index 48453610b..a3e2463e4 100644 --- a/src/core/ns_saset.c +++ b/src/core/ns_saset.c @@ -211,6 +211,8 @@ int do_saset_display(User * u, NickCore * nc, char *param) return MOD_CONT; } + alog("%s: %s!%s@%s set the display of %s to: %s", + s_NickServ, u->nick, u->username, u->host, nc->display, param); change_core_display(nc, param); notice_lang(s_NickServ, u, NICK_SASET_DISPLAY_CHANGED, nc->display); @@ -273,10 +275,14 @@ int do_saset_url(User * u, NickCore * nc, char *param) if (param) { nc->url = sstrdup(param); + alog("%s: %s!%s@%s set the url of %s to: %s", + s_NickServ, u->nick, u->username, u->host, nc->display, nc->url); notice_lang(s_NickServ, u, NICK_SASET_URL_CHANGED, nc->display, param); } else { nc->url = NULL; + alog("%s: %s!%s@%s unset the url of %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_URL_UNSET, nc->display); } return MOD_CONT; @@ -323,11 +329,15 @@ int do_saset_icq(User * u, NickCore * nc, char *param) notice_lang(s_NickServ, u, NICK_SASET_ICQ_INVALID, param); } else { nc->icq = tmp; + alog("%s: %s!%s@%s set the icq of %s to: %d", + s_NickServ, u->nick, u->username, u->host, nc->display, nc->icq); notice_lang(s_NickServ, u, NICK_SASET_ICQ_CHANGED, nc->display, param); } } else { nc->icq = 0; + alog("%s: %s!%s@%s unset the icq of %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_ICQ_UNSET, nc->display); } return MOD_CONT; @@ -346,10 +356,14 @@ int do_saset_greet(User * u, NickCore * nc, char *param) (end ? end : "")); nc->greet = sstrdup(buf); + alog("%s: %s!%s@%s set the greet of %s to: %s", + s_NickServ, u->nick, u->username, u->host, nc->display, nc->greet); notice_lang(s_NickServ, u, NICK_SASET_GREET_CHANGED, nc->display, buf); } else { nc->greet = NULL; + alog("%s: %s!%s@%s unset the greet of %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_GREET_UNSET, nc->display); } return MOD_CONT; @@ -360,21 +374,29 @@ int do_saset_kill(User * u, NickCore * nc, char *param) if (stricmp(param, "ON") == 0) { nc->flags |= NI_KILLPROTECT; nc->flags &= ~(NI_KILL_QUICK | NI_KILL_IMMED); + alog("%s: %s!%s@%s set kill ON for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_KILL_ON, nc->display); } else if (stricmp(param, "QUICK") == 0) { nc->flags |= NI_KILLPROTECT | NI_KILL_QUICK; nc->flags &= ~NI_KILL_IMMED; + alog("%s: %s!%s@%s set kill QUICK for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_KILL_QUICK, nc->display); } else if (stricmp(param, "IMMED") == 0) { if (NSAllowKillImmed) { nc->flags |= NI_KILLPROTECT | NI_KILL_IMMED; nc->flags &= ~NI_KILL_QUICK; + alog("%s: %s!%s@%s set kill IMMED for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_KILL_IMMED, nc->display); } else { notice_lang(s_NickServ, u, NICK_SASET_KILL_IMMED_DISABLED); } } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~(NI_KILLPROTECT | NI_KILL_QUICK | NI_KILL_IMMED); + alog("%s: %s!%s@%s set kill OFF for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_KILL_OFF, nc->display); } else { syntax_error(s_NickServ, u, "SASET KILL", @@ -388,9 +410,13 @@ int do_saset_secure(User * u, NickCore * nc, char *param) { if (stricmp(param, "ON") == 0) { nc->flags |= NI_SECURE; + alog("%s: %s!%s@%s set secure ON for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_SECURE_ON, nc->display); } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~NI_SECURE; + alog("%s: %s!%s@%s set secure OFF for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_SECURE_OFF, nc->display); } else { syntax_error(s_NickServ, u, "SASET SECURE", @@ -403,9 +429,13 @@ int do_saset_private(User * u, NickCore * nc, char *param) { if (stricmp(param, "ON") == 0) { nc->flags |= NI_PRIVATE; + alog("%s: %s!%s@%s set private ON for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_PRIVATE_ON, nc->display); } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~NI_PRIVATE; + alog("%s: %s!%s@%s set private OFF for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_PRIVATE_OFF, nc->display); } else { syntax_error(s_NickServ, u, "SASET PRIVATE", @@ -423,9 +453,13 @@ int do_saset_msg(User * u, NickCore * nc, char *param) if (stricmp(param, "ON") == 0) { nc->flags |= NI_MSG; + alog("%s: %s!%s@%s set msg ON for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_MSG_ON, nc->display); } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~NI_MSG; + alog("%s: %s!%s@%s set msg OFF for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_MSG_OFF, nc->display); } else { syntax_error(s_NickServ, u, "SASET MSG", NICK_SASET_MSG_SYNTAX); @@ -436,6 +470,7 @@ int do_saset_msg(User * u, NickCore * nc, char *param) int do_saset_hide(User * u, NickCore * nc, char *param) { int flag, onmsg, offmsg; + char *param2; if (stricmp(param, "EMAIL") == 0) { flag = NI_HIDE_EMAIL; @@ -458,18 +493,23 @@ int do_saset_hide(User * u, NickCore * nc, char *param) return MOD_CONT; } - param = strtok(NULL, " "); - if (!param) { + param2 = strtok(NULL, " "); + if (!param2) { syntax_error(s_NickServ, u, "SASET HIDE", NICK_SASET_HIDE_SYNTAX); - } else if (stricmp(param, "ON") == 0) { + } else if (stricmp(param2, "ON") == 0) { nc->flags |= flag; + alog("%s: %s!%s@%s set hide %s ON for %s", + s_NickServ, u->nick, u->username, u->host, param, nc->display); notice_lang(s_NickServ, u, onmsg, nc->display, s_NickServ); - } else if (stricmp(param, "OFF") == 0) { + } else if (stricmp(param2, "OFF") == 0) { nc->flags &= ~flag; + alog("%s: %s!%s@%s set hide %s OFF for %s", + s_NickServ, u->nick, u->username, u->host, param, nc->display); notice_lang(s_NickServ, u, offmsg, nc->display, s_NickServ); } else { syntax_error(s_NickServ, u, "SASET HIDE", NICK_SASET_HIDE_SYNTAX); } + return MOD_CONT; } @@ -482,9 +522,13 @@ int do_saset_noexpire(User * u, NickAlias * na, char *param) } if (stricmp(param, "ON") == 0) { na->status |= NS_NO_EXPIRE; + alog("%s: %s!%s@%s set noexpire ON for %s", + s_NickServ, u->nick, u->username, u->host, na->nick); notice_lang(s_NickServ, u, NICK_SASET_NOEXPIRE_ON, na->nick); } else if (stricmp(param, "OFF") == 0) { na->status &= ~NS_NO_EXPIRE; + alog("%s: %s!%s@%s set noexpire OFF for %s", + s_NickServ, u->nick, u->username, u->host, na->nick); notice_lang(s_NickServ, u, NICK_SASET_NOEXPIRE_OFF, na->nick); } else { syntax_error(s_NickServ, u, "SASET NOEXPIRE", @@ -497,9 +541,13 @@ int do_saset_autoop(User * u, NickCore * nc, char *param) { if (stricmp(param, "ON") == 0) { nc->flags &= ~NI_AUTOOP; + alog("%s: %s!%s@%s set autoop ON for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_AUTOOP_ON, nc->display); } else if (stricmp(param, "OFF") == 0) { nc->flags |= NI_AUTOOP; + alog("%s: %s!%s@%s set autoop OFF for %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SASET_AUTOOP_OFF, nc->display); } else { syntax_error(s_NickServ, u, "SET AUTOOP", NICK_SASET_AUTOOP_SYNTAX); @@ -524,6 +572,8 @@ int do_saset_language(User * u, NickCore * nc, char *param) return MOD_CONT; } nc->language = langlist[langnum]; + alog("%s: %s!%s@%s set the language of %s to %s", + s_NickServ, u->nick, u->username, u->host, nc->display, getstring2(nc, LANG_NAME)); notice_lang(s_NickServ, u, NICK_SASET_LANGUAGE_CHANGED, nc->display, getstring2(nc, LANG_NAME)); return MOD_CONT; diff --git a/src/core/ns_set.c b/src/core/ns_set.c index a5459e92e..f7fe83cbd 100644 --- a/src/core/ns_set.c +++ b/src/core/ns_set.c @@ -191,6 +191,8 @@ int do_set_display(User * u, NickCore * nc, char *param) } change_core_display(nc, param); + alog("%s: %s!%s@%s set their display nick to %s", + s_NickServ, u->nick, u->username, u->host, nc->display); notice_lang(s_NickServ, u, NICK_SET_DISPLAY_CHANGED, nc->display); /* Enable nick tracking if enabled */ @@ -250,6 +252,8 @@ int do_set_language(User * u, NickCore * nc, char *param) return MOD_CONT; } nc->language = langlist[langnum]; + alog("%s: %s!%s@%s set their language to %s", + s_NickServ, u->nick, u->username, u->host, getstring2(nc, LANG_NAME)); notice_lang(s_NickServ, u, NICK_SET_LANGUAGE_CHANGED); return MOD_CONT; } @@ -261,9 +265,13 @@ int do_set_url(User * u, NickCore * nc, char *param) if (param) { nc->url = sstrdup(param); + alog("%s: %s!%s@%s set their url to %s", + s_NickServ, u->nick, u->username, u->host, nc->url); notice_lang(s_NickServ, u, NICK_SET_URL_CHANGED, param); } else { nc->url = NULL; + alog("%s: %s!%s@%s unset their url", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_URL_UNSET); } return MOD_CONT; @@ -304,10 +312,14 @@ int do_set_icq(User * u, NickCore * nc, char *param) notice_lang(s_NickServ, u, NICK_SET_ICQ_INVALID, param); } else { nc->icq = tmp; + alog("%s: %s!%s@%s set their icq to %d", + s_NickServ, u->nick, u->username, u->host, nc->icq); notice_lang(s_NickServ, u, NICK_SET_ICQ_CHANGED, param); } } else { nc->icq = 0; + alog("%s: %s!%s@%s unset their icq", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_ICQ_UNSET); } return MOD_CONT; @@ -326,6 +338,8 @@ int do_set_greet(User * u, NickCore * nc, char *param) (end ? end : "")); nc->greet = sstrdup(buf); + alog("%s: %s!%s@%s set their greet to %s", + s_NickServ, u->nick, u->username, u->host, nc->greet); notice_lang(s_NickServ, u, NICK_SET_GREET_CHANGED, buf); } else { nc->greet = NULL; @@ -339,21 +353,29 @@ int do_set_kill(User * u, NickCore * nc, char *param) if (stricmp(param, "ON") == 0) { nc->flags |= NI_KILLPROTECT; nc->flags &= ~(NI_KILL_QUICK | NI_KILL_IMMED); + alog("%s: %s!%s@%s set kill ON", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_KILL_ON); } else if (stricmp(param, "QUICK") == 0) { nc->flags |= NI_KILLPROTECT | NI_KILL_QUICK; nc->flags &= ~NI_KILL_IMMED; + alog("%s: %s!%s@%s set kill QUICK", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_KILL_QUICK); } else if (stricmp(param, "IMMED") == 0) { if (NSAllowKillImmed) { nc->flags |= NI_KILLPROTECT | NI_KILL_IMMED; nc->flags &= ~NI_KILL_QUICK; + alog("%s: %s!%s@%s set kill IMMED", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_KILL_IMMED); } else { notice_lang(s_NickServ, u, NICK_SET_KILL_IMMED_DISABLED); } } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~(NI_KILLPROTECT | NI_KILL_QUICK | NI_KILL_IMMED); + alog("%s: %s!%s@%s set kill OFF", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_KILL_OFF); } else { syntax_error(s_NickServ, u, "SET KILL", @@ -367,9 +389,13 @@ int do_set_secure(User * u, NickCore * nc, char *param) { if (stricmp(param, "ON") == 0) { nc->flags |= NI_SECURE; + alog("%s: %s!%s@%s set secure ON", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_SECURE_ON); } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~NI_SECURE; + alog("%s: %s!%s@%s set secure OFF", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_SECURE_OFF); } else { syntax_error(s_NickServ, u, "SET SECURE", NICK_SET_SECURE_SYNTAX); @@ -381,9 +407,13 @@ int do_set_private(User * u, NickCore * nc, char *param) { if (stricmp(param, "ON") == 0) { nc->flags |= NI_PRIVATE; + alog("%s: %s!%s@%s set private ON", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_PRIVATE_ON); } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~NI_PRIVATE; + alog("%s: %s!%s@%s set private OFF", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_PRIVATE_OFF); } else { syntax_error(s_NickServ, u, "SET PRIVATE", @@ -401,9 +431,13 @@ int do_set_msg(User * u, NickCore * nc, char *param) if (stricmp(param, "ON") == 0) { nc->flags |= NI_MSG; + alog("%s: %s!%s@%s set msg ON", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_MSG_ON); } else if (stricmp(param, "OFF") == 0) { nc->flags &= ~NI_MSG; + alog("%s: %s!%s@%s set msg OFF", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_MSG_OFF); } else { syntax_error(s_NickServ, u, "SET MSG", NICK_SET_MSG_SYNTAX); @@ -414,6 +448,7 @@ int do_set_msg(User * u, NickCore * nc, char *param) int do_set_hide(User * u, NickCore * nc, char *param) { int flag, onmsg, offmsg; + char *param2; if (stricmp(param, "EMAIL") == 0) { flag = NI_HIDE_EMAIL; @@ -436,18 +471,23 @@ int do_set_hide(User * u, NickCore * nc, char *param) return MOD_CONT; } - param = strtok(NULL, " "); - if (!param) { + param2 = strtok(NULL, " "); + if (!param2) { syntax_error(s_NickServ, u, "SET HIDE", NICK_SET_HIDE_SYNTAX); - } else if (stricmp(param, "ON") == 0) { + } else if (stricmp(param2, "ON") == 0) { nc->flags |= flag; + alog("%s: %s!%s@%s set hide %s ON", + s_NickServ, u->nick, u->username, u->host, param); notice_lang(s_NickServ, u, onmsg, s_NickServ); - } else if (stricmp(param, "OFF") == 0) { + } else if (stricmp(param2, "OFF") == 0) { nc->flags &= ~flag; + alog("%s: %s!%s@%s set hide %s OFF", + s_NickServ, u->nick, u->username, u->host, param); notice_lang(s_NickServ, u, offmsg, s_NickServ); } else { syntax_error(s_NickServ, u, "SET HIDE", NICK_SET_HIDE_SYNTAX); } + return MOD_CONT; } @@ -460,9 +500,13 @@ int do_set_autoop(User *u, NickCore *nc, char *param) { **/ if (stricmp(param, "ON") == 0) { nc->flags &= ~NI_AUTOOP; + alog("%s: %s!%s@%s set autoop ON", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_AUTOOP_ON); } else if (stricmp(param, "OFF") == 0) { - nc->flags |= NI_AUTOOP; + nc->flags |= NI_AUTOOP; + alog("%s: %s!%s@%s set autoop OFF", + s_NickServ, u->nick, u->username, u->host); notice_lang(s_NickServ, u, NICK_SET_AUTOOP_OFF); } else { syntax_error(s_NickServ, u, "SET AUTOOP", NICK_SET_AUTOOP_SYNTAX); diff --git a/src/messages.c b/src/messages.c index fbdf33978..1c98a8bcf 100644 --- a/src/messages.c +++ b/src/messages.c @@ -195,11 +195,13 @@ int m_privmsg(char *source, char *receiver, char *msg) && (stricmp(receiver, s_OperServAlias) == 0))) { if (!is_oper(u) && OSOpersOnly) { notice_lang(s_OperServ, u, ACCESS_DENIED); - if (WallBadOS) + if (WallBadOS) { anope_cmd_global(s_OperServ, "Denied access to %s from %s!%s@%s (non-oper)", s_OperServ, u->nick, u->username, u->host); + alog("%s: %s (DENIED): %s", s_OperServ, u->nick, msg); + } } else { operserv(u, msg); } diff --git a/version.log b/version.log index 18f9f24a8..5041a173a 100644 --- a/version.log +++ b/version.log @@ -12,6 +12,7 @@ VERSION_EXTRA="-svn" VERSION_BUILD="2950" # $Log$ # Changes since the 1.8.4 Release +#Revision 2952 - Added a tonne of alog()s to log all stateful commands #Revision 2950 - Added support for building with Microsoft Visual Studio 2010 and removed support for Microsoft Visual Studio 98 #Revision 2947 - Fixed a memory leak and use of uninitialized values in unreal_jointhrottle_mode_check. Note we don't even use this function currently. #Revision 2946 - Fixed bug #1161 - Fixed setting expiry times on akills in the atheme2anope database converter |