diff options
author | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-18 15:29:58 +0000 |
---|---|---|
committer | aquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-18 15:29:58 +0000 |
commit | 58ecf39129ae6d1e5a15785c7bb8bf0fd5ee46b9 (patch) | |
tree | edfb4ec7ebd0e0cb28a685c5217d430d25478995 /src/mode.cpp | |
parent | 21bb2f2acf59f1bdf2853908fe82601531068a21 (diff) |
Implement <disabled:usermodes> and <disabled:chanmodes>.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10032 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<std::string>& 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 */ |