]> jfr.im git - solanum.git/blob - extensions/restrict-unauthenticated.c
extensions/extb_ssl.c: make certfp parameter case-insensitive
[solanum.git] / extensions / restrict-unauthenticated.c
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 const char restrict_desc[] =
20 "Restrict unautenticated users from doing anything as channel ops";
21
22 static void hack_channel_access(void *data);
23
24 mapi_hfn_list_av1 restrict_unauthenticated_hfnlist[] = {
25 { "get_channel_access", (hookfn) hack_channel_access },
26 { NULL, NULL }
27 };
28
29 static void
30 hack_channel_access(void *vdata)
31 {
32 hook_data_channel_approval *data = (hook_data_channel_approval *) vdata;
33
34 if (!MyClient(data->client))
35 return;
36
37 if (EmptyString(data->client->user->suser))
38 data->approved = 0;
39 }
40
41 DECLARE_MODULE_AV2(restrict_unauthenticated, NULL, NULL, NULL, NULL,
42 restrict_unauthenticated_hfnlist, NULL, NULL, restrict_desc);