X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmode.cpp;h=bce2b20191493a115f6957470bbe4d1f71f06847;hb=2d4a319d961e3f9e6aa9f7926f9ed320d72de8da;hp=ca30f1b699ad569ab7cc2913f1bb0895dc1f6c4a;hpb=9ab90c52b46cc613d29174fd183330bd9ace1e97;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/mode.cpp b/src/mode.cpp index ca30f1b69..bce2b2019 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -641,6 +641,17 @@ void ModeParser::Process(const std::vector& parameters, User *user, if (abort) continue; + /* If it's disabled, they have to be an oper. + */ + if (IS_LOCAL(user) && !IS_OPER(user) && ((type == MODETYPE_CHANNEL ? ServerInstance->Config->DisabledCModes : ServerInstance->Config->DisabledUModes)[modehandlers[handler_id]->GetModeChar() - 'A'])) + { + user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Permission Denied - %s mode %c has been locked by the administrator", + user->nick.c_str(), + type == MODETYPE_CHANNEL ? "channel" : "user", + modehandlers[handler_id]->GetModeChar()); + continue; + } + /* It's an oper only mode, check if theyre an oper. If they arent, * eat any parameter that came with the mode, and continue to next */