aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_ojoin.cpp
diff options
context:
space:
mode:
authorGravatar danieldg2010-02-05 15:58:58 +0000
committerGravatar danieldg2010-02-05 15:58:58 +0000
commit82a3069c5604a8b815021532ebfcc98cb50c9c7d (patch)
tree73c85c53db886fcac2d08f5fceeda47cc9601dc3 /src/modules/m_ojoin.cpp
parentDon't enforce access control on remote users for topic changes (diff)
downloadinspircd++-82a3069c5604a8b815021532ebfcc98cb50c9c7d.tar.gz
inspircd++-82a3069c5604a8b815021532ebfcc98cb50c9c7d.tar.bz2
inspircd++-82a3069c5604a8b815021532ebfcc98cb50c9c7d.zip
Remove incorrect access checks from m_ojoin
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12377 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_ojoin.cpp')
-rw-r--r--src/modules/m_ojoin.cpp63
1 files changed, 10 insertions, 53 deletions
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 6e9e36812..38497f1bb 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -132,39 +132,6 @@ class NetworkPrefix : public ModeHandler
}
}
- User* FindAndVerify(std::string &parameter, Channel* channel)
- {
- User* theuser = ServerInstance->FindNick(parameter);
- if ((!theuser) || (!channel->HasUser(theuser)))
- {
- parameter.clear();
- return NULL;
- }
- return theuser;
- }
-
- ModeAction HandleChange(User* source, User* theuser, bool adding, Channel* channel, std::string &parameter)
- {
- Membership* m = channel->GetUser(theuser);
- if (m && adding)
- {
- if (!m->hasMode('Y'))
- {
- parameter = theuser->nick;
- return MODEACTION_ALLOW;
- }
- }
- else if (m && !adding)
- {
- if (m->hasMode('Y'))
- {
- parameter = theuser->nick;
- return MODEACTION_ALLOW;
- }
- }
- return MODEACTION_DENY;
- }
-
unsigned int GetPrefixRank()
{
return NETWORK_VALUE;
@@ -174,29 +141,19 @@ class NetworkPrefix : public ModeHandler
{
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+ ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding)
{
- User* theuser = FindAndVerify(parameter, channel);
+ User* theuser = ServerInstance->FindNick(parameter);
+ // remove own privs?
+ if (source == theuser && !adding)
+ return MOD_RES_ALLOW;
- if (!theuser)
- return MODEACTION_DENY;
+ return MOD_RES_PASSTHRU;
+ }
- // source is a server, or ulined, we'll let them +-Y the user.
- if (source == ServerInstance->FakeClient ||
- ((source == theuser) && (!adding)) ||
- (ServerInstance->ULine(source->nick.c_str())) ||
- (ServerInstance->ULine(source->server)) ||
- (!IS_LOCAL(source))
- )
- {
- return HandleChange(source, theuser, adding, channel, parameter);
- }
- else
- {
- // bzzzt, wrong answer!
- source->WriteNumeric(482, "%s %s :Only servers may change this mode.", source->nick.c_str(), channel->name.c_str());
- return MODEACTION_DENY;
- }
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+ {
+ return MODEACTION_ALLOW;
}
};