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
19 static void h_gla_client_exit(hook_data_client_exit
*);
21 mapi_hfn_list_av1 gla_hfnlist
[] = {
22 { "client_exit", (hookfn
) h_gla_client_exit
},
26 DECLARE_MODULE_AV1(globallineactive
, NULL
, NULL
, NULL
, NULL
, gla_hfnlist
, "$Revision: 613 $");
29 h_gla_client_exit(hook_data_client_exit
*hdata
)
31 struct Client
*source_p
;
33 source_p
= hdata
->target
;
35 if (MyConnect(source_p
) || !IsClient(source_p
))
37 if (!strcmp(hdata
->comment
, "Bad user info"))
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
);
43 else if (ConfigFileEntry
.kline_reason
!= NULL
&&
44 !strcmp(hdata
->comment
, ConfigFileEntry
.kline_reason
))
46 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
47 "K/DLINE active for %s[%s@%s]",
48 source_p
->name
, source_p
->username
, source_p
->host
);
50 else if (!strncmp(hdata
->comment
, "Temporary K-line ", 17))
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
);
56 else if (!strncmp(hdata
->comment
, "Temporary D-line ", 17))
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
);