]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/createauthonly.c
BOPM/TCM do not need the ability to global kill, so remove it from server_bot
[irc/rqf/shadowircd.git] / extensions / createauthonly.c
CommitLineData
212380e3 1/*
2 * This module restricts channel creation to authenticated users
b47db00e
JT
3 * and IRC operators only. This module could be useful for
4 * running private chat systems, or if a network gets droneflood
5 * problems. It will return ERR_NEEDREGGEDNICK on failure.
212380e3 6 * -- nenolod
7 *
8 * $Id: createauthonly.c 833 2006-02-15 00:27:59Z jilles $
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
21static void h_can_create_channel_authenticated(hook_data_client_approval *);
22
23mapi_hfn_list_av1 restrict_hfnlist[] = {
24 { "can_create_channel", (hookfn) h_can_create_channel_authenticated },
25 { NULL, NULL }
26};
27
28DECLARE_MODULE_AV1(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 833 $");
29
30static void
31h_can_create_channel_authenticated(hook_data_client_approval *data)
32{
33 struct Client *source_p = data->client;
34
b47db00e 35 if (*source_p->user->suser == '\0' && !IsOper(source_p))
212380e3 36 data->approved = ERR_NEEDREGGEDNICK;
37}