diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-01 20:28:13 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-01 20:28:13 +0000 |
commit | 952b577edce0bf3affc4a0891586115dc3ab5d32 (patch) | |
tree | c6213cb9c100a7dd7da3490fe9d491c5cd3c8525 /src | |
parent | b6caf5f91528e2825452e329344909e90c04c095 (diff) |
Only access-check local user kicks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3008 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 19cf14d55..a77947126 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -458,12 +458,15 @@ void server_kick_channel(userrec* user, chanrec* Ptr, char* reason, bool trigger return; } - if (!has_channel(user,Ptr)) + if (IS_LOCAL(user)) { - /* Not on channel */ - return; + if (!has_channel(user,Ptr)) + { + /* Not on channel */ + return; + } } - + if (triggerevents) { FOREACH_MOD(I_OnUserKick,OnUserKick(NULL,user,Ptr,reason)); @@ -508,41 +511,42 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) log(DEBUG,"kick_channel: removing: %s %s %s",user->nick,Ptr->name,src->nick); - if (!has_channel(user,Ptr)) - { - WriteServ(src->fd,"441 %s %s %s :They are not on that channel",src->nick, user->nick, Ptr->name); - return; - } - - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,Ptr,AC_KICK)); - if ((MOD_RESULT == ACR_DENY) && (!is_uline(src->server))) - return; - - if ((MOD_RESULT == ACR_DEFAULT) || (!is_uline(src->server))) - { - if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) - { - if (cstatus(src,Ptr) == STATUS_HOP) - { - WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name); - } - else - { - WriteServ(src->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",src->nick, Ptr->name); - } - - return; - } - } - - if (!is_uline(src->server)) - { - MOD_RESULT = 0; - FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,Ptr,reason)); - if (MOD_RESULT) - return; - } + if (IS_LOCAL(user)) + { + if (!has_channel(user,Ptr)) + { + WriteServ(src->fd,"441 %s %s %s :They are not on that channel",src->nick, user->nick, Ptr->name); + return; + } + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,Ptr,AC_KICK)); + if ((MOD_RESULT == ACR_DENY) && (!is_uline(src->server))) + return; + + if ((MOD_RESULT == ACR_DEFAULT) || (!is_uline(src->server))) + { + if ((cstatus(src,Ptr) < STATUS_HOP) || (cstatus(src,Ptr) < cstatus(user,Ptr))) + { + if (cstatus(src,Ptr) == STATUS_HOP) + { + WriteServ(src->fd,"482 %s %s :You must be a channel operator",src->nick, Ptr->name); + } + else + { + WriteServ(src->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",src->nick, Ptr->name); + } + + return; + } + } + if (!is_uline(src->server)) + { + MOD_RESULT = 0; + FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,Ptr,reason)); + if (MOD_RESULT) + return; + } + } FOREACH_MOD(I_OnUserKick,OnUserKick(src,user,Ptr,reason)); |