summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-05 15:58:58 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-05 15:58:58 +0000
commit82a3069c5604a8b815021532ebfcc98cb50c9c7d (patch)
tree73c85c53db886fcac2d08f5fceeda47cc9601dc3 /src
parentf208e9477f08d5780038782c7a2b0cd506058994 (diff)
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')
-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,71 +132,28 @@ class NetworkPrefix : public ModeHandler
}
}
- User* FindAndVerify(std::string &parameter, Channel* channel)
+ unsigned int GetPrefixRank()
{
- User* theuser = ServerInstance->FindNick(parameter);
- if ((!theuser) || (!channel->HasUser(theuser)))
- {
- parameter.clear();
- return NULL;
- }
- return theuser;
+ return NETWORK_VALUE;
}
- ModeAction HandleChange(User* source, User* theuser, bool adding, Channel* channel, std::string &parameter)
+ void RemoveMode(User* user, irc::modestacker* stack)
{
- 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()
+ ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding)
{
- return NETWORK_VALUE;
- }
+ User* theuser = ServerInstance->FindNick(parameter);
+ // remove own privs?
+ if (source == theuser && !adding)
+ return MOD_RES_ALLOW;
- void RemoveMode(User* user, irc::modestacker* stack)
- {
+ return MOD_RES_PASSTHRU;
}
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
{
- User* theuser = FindAndVerify(parameter, channel);
-
- if (!theuser)
- return MODEACTION_DENY;
-
- // 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;
- }
+ return MODEACTION_ALLOW;
}
};