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
9 * $Id: sno_globalkline.c 613 2006-01-29 03:03:02Z nenolod $
20 static void h_gla_client_exit(hook_data_client_exit
*);
22 mapi_hfn_list_av1 gla_hfnlist
[] = {
23 { "client_exit", (hookfn
) h_gla_client_exit
},
27 DECLARE_MODULE_AV1(globallineactive
, NULL
, NULL
, NULL
, NULL
, gla_hfnlist
, "$Revision: 613 $");
30 h_gla_client_exit(hook_data_client_exit
*hdata
)
32 struct Client
*source_p
;
34 source_p
= hdata
->target
;
36 if (MyConnect(source_p
) || !IsClient(source_p
))
38 if (!strcmp(hdata
->comment
, "Bad user info"))
40 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
41 "XLINE active for %s[%s@%s]",
42 source_p
->name
, source_p
->username
, source_p
->host
);
44 else if (ConfigFileEntry
.kline_reason
!= NULL
&&
45 !strcmp(hdata
->comment
, ConfigFileEntry
.kline_reason
))
47 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
48 "K/DLINE active for %s[%s@%s]",
49 source_p
->name
, source_p
->username
, source_p
->host
);
51 else if (!strncmp(hdata
->comment
, "Temporary K-line ", 17))
53 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
54 "K/DLINE active for %s[%s@%s]",
55 source_p
->name
, source_p
->username
, source_p
->host
);
57 else if (!strncmp(hdata
->comment
, "Temporary D-line ", 17))
59 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
60 "K/DLINE active for %s[%s@%s]",
61 source_p
->name
, source_p
->username
, source_p
->host
);