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
18 static void h_gla_client_exit(hook_data_client_exit
*);
20 mapi_hfn_list_av1 gla_hfnlist
[] = {
21 { "client_exit", (hookfn
) h_gla_client_exit
},
25 DECLARE_MODULE_AV1(globallineactive
, NULL
, NULL
, NULL
, NULL
, gla_hfnlist
, "$Revision: 613 $");
28 h_gla_client_exit(hook_data_client_exit
*hdata
)
30 struct Client
*source_p
;
32 source_p
= hdata
->target
;
34 if (MyConnect(source_p
) || !IsClient(source_p
))
36 if (!strcmp(hdata
->comment
, "Bad user info"))
38 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
39 "XLINE active for %s[%s@%s]",
40 source_p
->name
, source_p
->username
, source_p
->host
);
42 else if (ConfigFileEntry
.kline_reason
!= NULL
&&
43 !strcmp(hdata
->comment
, ConfigFileEntry
.kline_reason
))
45 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
46 "K/DLINE active for %s[%s@%s]",
47 source_p
->name
, source_p
->username
, source_p
->host
);
49 else if (!strncmp(hdata
->comment
, "Temporary K-line ", 17))
51 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
52 "K/DLINE active for %s[%s@%s]",
53 source_p
->name
, source_p
->username
, source_p
->host
);
55 else if (!strncmp(hdata
->comment
, "Temporary D-line ", 17))
57 sendto_realops_snomask_from(SNO_GENERAL
, L_ALL
, source_p
->servptr
,
58 "K/DLINE active for %s[%s@%s]",
59 source_p
->name
, source_p
->username
, source_p
->host
);