]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/sno_globalkline.c
Removal of ancient SVN ID's part one
[irc/rqf/shadowircd.git] / extensions / sno_globalkline.c
CommitLineData
212380e3 1/*
2 * Shows notices if remote clients exit with "Bad user info" or
3 * ConfigFileEntry.kline_reason.
4 * Assumes client_exit is enabled so users can't fake these reasons,
5 * and kline_reason is enabled and the same everywhere.
6 * Yes, this is a hack, but it is simple and avoids sending
7 * more data across servers -- jilles
8 *
212380e3 9 */
10
11#include "stdinc.h"
12#include "modules.h"
13#include "client.h"
14#include "hook.h"
15#include "ircd.h"
16#include "send.h"
17#include "s_conf.h"
18
19static void h_gla_client_exit(hook_data_client_exit *);
20
21mapi_hfn_list_av1 gla_hfnlist[] = {
22 { "client_exit", (hookfn) h_gla_client_exit },
23 { NULL, NULL }
24};
25
26DECLARE_MODULE_AV1(globallineactive, NULL, NULL, NULL, NULL, gla_hfnlist, "$Revision: 613 $");
27
28static void
29h_gla_client_exit(hook_data_client_exit *hdata)
30{
31 struct Client *source_p;
32
33 source_p = hdata->target;
34
35 if (MyConnect(source_p) || !IsClient(source_p))
36 return;
37 if (!strcmp(hdata->comment, "Bad user info"))
38 {
39 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
40 "XLINE active for %s[%s@%s]",
41 source_p->name, source_p->username, source_p->host);
42 }
43 else if (ConfigFileEntry.kline_reason != NULL &&
44 !strcmp(hdata->comment, ConfigFileEntry.kline_reason))
45 {
46 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
d5a432fa 47 "K/DLINE active for %s[%s@%s]",
212380e3 48 source_p->name, source_p->username, source_p->host);
49 }
1f24b3b1
JT
50 else if (!strncmp(hdata->comment, "Temporary K-line ", 17))
51 {
52 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
53 "K/DLINE active for %s[%s@%s]",
54 source_p->name, source_p->username, source_p->host);
55 }
56 else if (!strncmp(hdata->comment, "Temporary D-line ", 17))
57 {
58 sendto_realops_snomask_from(SNO_GENERAL, L_ALL, source_p->servptr,
59 "K/DLINE active for %s[%s@%s]",
60 source_p->name, source_p->username, source_p->host);
61 }
212380e3 62}