aboutsummaryrefslogtreecommitdiffstats
path: root/src/mode.cpp
diff options
context:
space:
mode:
authorGravatar aquanight2008-03-23 20:43:35 +0000
committerGravatar aquanight2008-03-23 20:43:35 +0000
commit743c10e4ca5acd45e670b335a07b5bf3ab754ab6 (patch)
treeb71daa8b64cbbcdaba191afd9709dd896be12a6b /src/mode.cpp
parentWheeee for HUGE commits. Convert all numerics to WriteNumeric so that OnNumer... (diff)
downloadinspircd++-743c10e4ca5acd45e670b335a07b5bf3ab754ab6.tar.gz
inspircd++-743c10e4ca5acd45e670b335a07b5bf3ab754ab6.tar.bz2
inspircd++-743c10e4ca5acd45e670b335a07b5bf3ab754ab6.zip
Add ability to control what opertypes can set what operonly user/chan modes. This works the same way as commands, in that modes allowed by classes are added together, and * allows all.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9176 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 21d7fa412..db9641edb 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -577,10 +577,13 @@ void ModeParser::Process(const char* const* parameters, int pcnt, User *user, bo
/* 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
*/
- if ((IS_LOCAL(user)) && (modehandlers[handler_id]->NeedsOper()) && (!IS_OPER(user)))
+ if ((IS_LOCAL(user)) && (modehandlers[handler_id]->NeedsOper()) && (!user->HasModePermission(modehandlers[handler_id]->GetModeChar(), type)))
{
- user->WriteNumeric(481, "%s :Permission Denied - Only IRC operators may %sset %s mode %c", user->nick,
- adding ? "" : "un", type == MODETYPE_CHANNEL ? "channel" : "user",
+ user->WriteNumeric(481, "%s :Permission Denied - Oper type %s does not have access to %sset %s mode %c",
+ user->nick,
+ user->oper,
+ adding ? "" : "un",
+ type == MODETYPE_CHANNEL ? "channel" : "user",
modehandlers[handler_id]->GetModeChar());
continue;
}