]>
Commit | Line | Data |
---|---|---|
e5149d61 AC |
1 | /* |
2 | * restrict unauthenticated users from doing anything as channel op | |
3 | */ | |
4 | ||
5 | #include "stdinc.h" | |
6 | #include "modules.h" | |
7 | #include "hook.h" | |
8 | #include "client.h" | |
9 | #include "ircd.h" | |
10 | #include "send.h" | |
11 | #include "hash.h" | |
12 | #include "s_conf.h" | |
13 | #include "s_user.h" | |
14 | #include "s_serv.h" | |
15 | #include "numeric.h" | |
16 | #include "privilege.h" | |
17 | #include "s_newconf.h" | |
18 | ||
19 | static void hack_channel_access(void *data); | |
20 | ||
21 | mapi_hfn_list_av1 restrict_unauthenticated_hfnlist[] = { | |
22 | { "get_channel_access", (hookfn) hack_channel_access }, | |
23 | { NULL, NULL } | |
24 | }; | |
25 | ||
26 | static void | |
27 | hack_channel_access(void *vdata) | |
28 | { | |
29 | hook_data_channel_approval *data = (hook_data_channel_approval *) vdata; | |
30 | ||
31 | if (!MyClient(data->client)) | |
32 | return; | |
33 | ||
34 | if (EmptyString(data->client->user->suser)) | |
35 | data->approved = 0; | |
36 | } | |
37 | ||
38 | DECLARE_MODULE_AV1(restrict_unauthenticated, NULL, NULL, NULL, NULL, | |
04f832b7 | 39 | restrict_unauthenticated_hfnlist, NULL); |