X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..1548c140218b956485b3fd5c386447a2add59864:/extensions/createauthonly.c diff --git a/extensions/createauthonly.c b/extensions/createauthonly.c index 4f7477ac..2baa2e5a 100644 --- a/extensions/createauthonly.c +++ b/extensions/createauthonly.c @@ -1,11 +1,9 @@ /* * This module restricts channel creation to authenticated 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. + * 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. * -- nenolod - * - * $Id: createauthonly.c 833 2006-02-15 00:27:59Z jilles $ */ #include "stdinc.h" @@ -17,21 +15,25 @@ #include "s_conf.h" #include "snomask.h" #include "numeric.h" +#include "s_newconf.h" -static void h_can_create_channel_authenticated(hook_data_client_approval *); +static const char restrict_desc[] = "Restricts channel creation to authenticated users and IRC operators only"; + +static void h_can_create_channel_authenticated(void *); mapi_hfn_list_av1 restrict_hfnlist[] = { - { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, + { "can_create_channel", h_can_create_channel_authenticated }, { NULL, NULL } }; -DECLARE_MODULE_AV1(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 833 $"); +DECLARE_MODULE_AV2(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NULL, NULL, restrict_desc); static void -h_can_create_channel_authenticated(hook_data_client_approval *data) +h_can_create_channel_authenticated(void *data_) { + hook_data_client_approval *data = data_; struct Client *source_p = data->client; - if (*source_p->user->suser == '\0') + if (*source_p->user->suser == '\0' && !IsOperGeneral(source_p)) data->approved = ERR_NEEDREGGEDNICK; }