]> jfr.im git - solanum.git/blame - extensions/restrict-unauthenticated.c
m_stats: z: remove unnecessary casting and fix format strings
[solanum.git] / extensions / restrict-unauthenticated.c
CommitLineData
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
3fd3d7e1
EM
19static const char restrict_desc[] =
20 "Restrict unautenticated users from doing anything as channel ops";
21
e5149d61
AC
22static void hack_channel_access(void *data);
23
24mapi_hfn_list_av1 restrict_unauthenticated_hfnlist[] = {
82436efb 25 { "get_channel_access", hack_channel_access },
e5149d61
AC
26 { NULL, NULL }
27};
28
29static void
30hack_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
3fd3d7e1
EM
41DECLARE_MODULE_AV2(restrict_unauthenticated, NULL, NULL, NULL, NULL,
42 restrict_unauthenticated_hfnlist, NULL, NULL, restrict_desc);