]>
Commit | Line | Data |
---|---|---|
45ed9777 AC |
1 | /* |
2 | * This module restricts channel creation to opered up users | |
3 | * only. This module could be useful for running private chat | |
4 | * systems, or if a network gets droneflood problems. It will | |
5 | * return ERR_NEEDREGGEDNICK on failure. | |
6 | * -- nenolod | |
7 | * | |
8 | * $Id: createoperonly.c 3476 2007-05-24 04:28:36Z nenolod $ | |
9 | */ | |
10 | ||
11 | #include "stdinc.h" | |
12 | #include "modules.h" | |
13 | #include "client.h" | |
14 | #include "hook.h" | |
15 | #include "ircd.h" | |
16 | #include "send.h" | |
17 | #include "s_conf.h" | |
18 | #include "snomask.h" | |
19 | #include "numeric.h" | |
20 | ||
21 | static void h_can_create_channel_authenticated(hook_data_client_approval *); | |
22 | ||
23 | mapi_hfn_list_av1 restrict_hfnlist[] = { | |
24 | { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, | |
25 | { NULL, NULL } | |
26 | }; | |
27 | ||
28 | DECLARE_MODULE_AV1(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 3476 $"); | |
29 | ||
30 | static void | |
31 | h_can_create_channel_authenticated(hook_data_client_approval *data) | |
32 | { | |
33 | struct Client *source_p = data->client; | |
34 | ||
35 | if (!IsOper(source_p)) | |
36 | { | |
37 | sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only."); | |
38 | data->approved = ERR_NEEDREGGEDNICK; | |
39 | } | |
40 | } |