Add no_locops extension to disable LOCOPS (force everyone -l).

This commit is contained in:
Jilles Tjoelker 2007-12-25 13:27:41 +01:00
parent 16e0550f25
commit 63c26c4b5a
2 changed files with 34 additions and 0 deletions

View File

@ -54,6 +54,7 @@ SRCS = \
m_omode.c \
m_opme.c \
m_webirc.c \
no_locops.c \
no_oper_invis.c \
spy_admin_notice.c \
spy_info_notice.c \

33
extensions/no_locops.c Normal file
View File

@ -0,0 +1,33 @@
/*
* Disable LOCOPS (by disallowing any local user setting +l).
* -- jilles
*/
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "hook.h"
#include "ircd.h"
#include "send.h"
#include "s_conf.h"
#include "s_newconf.h"
static void h_nl_umode_changed(hook_data_umode_changed *);
mapi_hfn_list_av1 nl_hfnlist[] = {
{ "umode_changed", (hookfn) h_nl_umode_changed },
{ NULL, NULL }
};
DECLARE_MODULE_AV1(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, "$Revision: 3219 $");
static void
h_nl_umode_changed(hook_data_umode_changed *hdata)
{
struct Client *source_p = hdata->client;
if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS)
{
source_p->umodes &= ~UMODE_LOCOPS;
}
}