2007-12-25 13:27:41 +01:00
|
|
|
/*
|
|
|
|
* Disable LOCOPS (by disallowing any local user setting +l).
|
|
|
|
* -- jilles
|
|
|
|
*/
|
|
|
|
|
2016-07-01 05:04:00 +02:00
|
|
|
#include <ircd/stdinc.h>
|
|
|
|
#include <ircd/modules.h>
|
|
|
|
#include <ircd/client.h>
|
|
|
|
#include <ircd/hook.h>
|
|
|
|
#include <ircd/ircd.h>
|
|
|
|
#include <ircd/send.h>
|
|
|
|
#include <ircd/s_conf.h>
|
|
|
|
#include <ircd/s_newconf.h>
|
2007-12-25 13:27:41 +01:00
|
|
|
|
2016-03-07 10:50:03 +01:00
|
|
|
static const char no_locops_desc[] = "Disables local operators";
|
|
|
|
|
2007-12-25 13:27:41 +01:00
|
|
|
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 }
|
|
|
|
};
|
|
|
|
|
2016-03-07 10:50:03 +01:00
|
|
|
DECLARE_MODULE_AV2(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, NULL, NULL, no_locops_desc);
|
2007-12-25 13:27:41 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|