]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Disable LOCOPS (by disallowing any local user setting +l). | |
3 | * -- jilles | |
4 | */ | |
5 | ||
6 | #include "stdinc.h" | |
7 | #include "modules.h" | |
8 | #include "client.h" | |
9 | #include "hook.h" | |
10 | #include "ircd.h" | |
11 | #include "send.h" | |
12 | #include "s_conf.h" | |
13 | #include "s_newconf.h" | |
14 | ||
15 | static const char no_locops_desc[] = "Disables local operators"; | |
16 | ||
17 | static void h_nl_umode_changed(hook_data_umode_changed *); | |
18 | ||
19 | mapi_hfn_list_av1 nl_hfnlist[] = { | |
20 | { "umode_changed", (hookfn) h_nl_umode_changed }, | |
21 | { NULL, NULL } | |
22 | }; | |
23 | ||
24 | DECLARE_MODULE_AV2(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, NULL, NULL, no_locops_desc); | |
25 | ||
26 | static void | |
27 | h_nl_umode_changed(hook_data_umode_changed *hdata) | |
28 | { | |
29 | struct Client *source_p = hdata->client; | |
30 | ||
31 | if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS) | |
32 | { | |
33 | source_p->umodes &= ~UMODE_LOCOPS; | |
34 | } | |
35 | } |