2007-01-25 06:40:21 +00:00
|
|
|
/*
|
|
|
|
* This module restricts channel creation to authenticated users
|
2007-12-17 23:15:54 +00:00
|
|
|
* and IRC operators only. This module could be useful for
|
|
|
|
* running private chat systems, or if a network gets droneflood
|
|
|
|
* problems. It will return ERR_NEEDREGGEDNICK on failure.
|
2007-01-25 06:40:21 +00:00
|
|
|
* -- nenolod
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdinc.h"
|
|
|
|
#include "modules.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "hook.h"
|
|
|
|
#include "ircd.h"
|
|
|
|
#include "send.h"
|
|
|
|
#include "s_conf.h"
|
|
|
|
#include "snomask.h"
|
|
|
|
#include "numeric.h"
|
|
|
|
|
|
|
|
static void h_can_create_channel_authenticated(hook_data_client_approval *);
|
|
|
|
|
|
|
|
mapi_hfn_list_av1 restrict_hfnlist[] = {
|
2014-08-03 17:38:55 +00:00
|
|
|
{ "can_create_channel", (hookfn) h_can_create_channel_authenticated },
|
|
|
|
{ NULL, NULL }
|
2007-01-25 06:40:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_MODULE_AV1(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 833 $");
|
|
|
|
|
|
|
|
static void
|
|
|
|
h_can_create_channel_authenticated(hook_data_client_approval *data)
|
|
|
|
{
|
2014-08-03 17:38:55 +00:00
|
|
|
struct Client *source_p = data->client;
|
2007-01-25 06:40:21 +00:00
|
|
|
|
2014-08-03 17:38:55 +00:00
|
|
|
if (*source_p->user->suser == '\0' && !IsOper(source_p))
|
|
|
|
data->approved = ERR_NEEDREGGEDNICK;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|