X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_botmode.cpp;h=57ab1e91c0739d4e465c65d7a825223280001a9e;hb=9dd72b7003963d868a23da930a91300b49ab4959;hp=fa79c83f6d951c9b08eb96266077d7964e77150a;hpb=db07867e945deb72ce103f796e20104a27c5f68a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index fa79c83f6..57ab1e91c 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -21,6 +21,7 @@ using namespace std; #include "users.h" #include "channels.h" #include "modules.h" +#include "inspircd.h" /* $ModDesc: Provides support for unreal-style umode +B */ @@ -31,6 +32,10 @@ class BotMode : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { + /* Only opers can change other users modes */ + if ((source != dest) && (!*source->oper)) + return MODEACTION_DENY; + if (adding) { if (!dest->IsModeSet('B')) @@ -47,6 +52,8 @@ class BotMode : public ModeHandler return MODEACTION_ALLOW; } } + + return MODEACTION_DENY; } }; @@ -70,6 +77,7 @@ class ModuleBotMode : public Module virtual ~ModuleBotMode() { + DELETE(bm); } virtual Version GetVersion() @@ -112,4 +120,3 @@ extern "C" void * init_module( void ) { return new ModuleBotModeFactory; } -