From 45ed9777798f9fbb4fa3b2ab57e16361cfbbdab3 Mon Sep 17 00:00:00 2001 From: nenolod Date: Wed, 23 May 2007 21:28:36 -0700 Subject: [PATCH] [svn] - createoperonly: like createauthonly, but checks opered status instead of authed status --- ChangeLog | 12 +++++++++++ extensions/Makefile.in | 3 ++- extensions/createoperonly.c | 40 +++++++++++++++++++++++++++++++++++++ include/serno.h | 2 +- 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 extensions/createoperonly.c diff --git a/ChangeLog b/ChangeLog index c1772a4..1a74ed2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +nenolod 2007/05/24 04:16:02 UTC (20070524-3474) + Log: + - sno_channeljoin: implements snomask +j and sends channel join notices there from local users + + + Changes: Modified: + +1 -0 trunk/doc/example.conf (File Modified) + +3 -1 trunk/doc/reference.conf (File Modified) + +46 -0 trunk/extensions/Makefile.in (File Modified) + + - trunk/extensions/sno_channeljoin.c (File Added) + + nenolod 2007/05/24 04:02:33 UTC (20070524-3472) Log: - update config files diff --git a/extensions/Makefile.in b/extensions/Makefile.in index eba5382..90de382 100644 --- a/extensions/Makefile.in +++ b/extensions/Makefile.in @@ -1,7 +1,7 @@ # # Makefile.in for ircd/contrib # -# $Id: Makefile.in 3474 2007-05-24 04:16:02Z nenolod $ +# $Id: Makefile.in 3476 2007-05-24 04:28:36Z nenolod $ # CC = @CC@ RM = @RM@ @@ -28,6 +28,7 @@ CPPFLAGS = ${INCLUDES} @CPPFLAGS@ SRCS = \ createauthonly.c \ + createoperonly.c \ extb_account.c \ extb_canjoin.c \ extb_channel.c \ diff --git a/extensions/createoperonly.c b/extensions/createoperonly.c new file mode 100644 index 0000000..6e06338 --- /dev/null +++ b/extensions/createoperonly.c @@ -0,0 +1,40 @@ +/* + * This module restricts channel creation to opered up users + * 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. + * -- nenolod + * + * $Id: createoperonly.c 3476 2007-05-24 04:28:36Z 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[] = { + { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, + { NULL, NULL } +}; + +DECLARE_MODULE_AV1(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 3476 $"); + +static void +h_can_create_channel_authenticated(hook_data_client_approval *data) +{ + struct Client *source_p = data->client; + + if (!IsOper(source_p)) + { + sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only."); + data->approved = ERR_NEEDREGGEDNICK; + } +} diff --git a/include/serno.h b/include/serno.h index 55967ae..9d33426 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070524-3472" +#define SERNO "20070524-3474"