]>
Commit | Line | Data |
---|---|---|
b674a619 EK |
1 | #include "stdinc.h" |
2 | #include "modules.h" | |
3 | #include "hook.h" | |
4 | #include "client.h" | |
b674a619 | 5 | #include "s_conf.h" |
b674a619 EK |
6 | |
7 | static void check_new_user(void *data); | |
8 | mapi_hfn_list_av1 drain_hfnlist[] = { | |
9 | { "new_local_user", (hookfn) check_new_user }, | |
10 | { NULL, NULL } | |
11 | }; | |
12 | ||
13 | static const char drain_desc[] = "Prevents new, non-exempt users from connecting to this server."; | |
14 | ||
15 | DECLARE_MODULE_AV2(drain, NULL, NULL, NULL, NULL, | |
16 | drain_hfnlist, NULL, NULL, drain_desc); | |
17 | ||
18 | ||
19 | static void | |
20 | check_new_user(void *vdata) | |
21 | { | |
22 | struct Client *source_p = vdata; | |
23 | const char *drain_reason = ConfigFileEntry.drain_reason; | |
24 | ||
25 | if (drain_reason == NULL) | |
26 | drain_reason = "This server is not accepting connections."; | |
27 | ||
28 | if(IsExemptKline(source_p)) | |
29 | return; | |
30 | ||
31 | exit_client(source_p, source_p, &me, drain_reason); | |
32 | } |