diff options
| author | 2006-06-24 18:00:35 +0000 | |
|---|---|---|
| committer | 2006-06-24 18:00:35 +0000 | |
| commit | 3bdd25e560f7c97433ceab0f09810f2be36bf131 (patch) | |
| tree | 18d7975de94e143d1a0c45caced25bb3f0054467 /src/modules/m_remove.cpp | |
| parent | Pointer safety for Write* functions (check the local user exists in the fd_re... (diff) | |
Dont allow /REMOVE of a uline, dont allow /REMOVE of a user who isnt on the channel (*slaps* Om)
git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4058 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_remove.cpp')
| -rw-r--r-- | src/modules/m_remove.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index dedbe0ac3..7a114fa23 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -89,6 +89,12 @@ class cmd_remove : public command_t /* If the target nick exists... */ if (target && channel) { + if (!channel->HasUser(target)) + { + Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** The user "+target->nick+" is not on channel "+channel->name); + return; + } + for (unsigned int x = 0; x < strlen(parameters[1]); x++) { if ((parameters[1][0] != '#') || (parameters[1][x] == ' ') || (parameters[1][x] == ',')) @@ -118,7 +124,7 @@ class cmd_remove : public command_t if(ulevel > 1) { /* For now, we'll let everyone remove their level and below, eg ops can remove ops, halfops, voices, and those with no mode (no moders actually are set to 1) */ - if(ulevel >= tlevel && tlevel != 5) + if ((ulevel >= tlevel && tlevel != 5) && (!Srv->IsUlined(target->server))) { Srv->PartUserFromChannel(target,std::string(parameters[1]), "Removed by "+std::string(user->nick)+":"+result); Srv->SendTo(NULL,user,"NOTICE "+std::string(channel->name)+" : "+std::string(user->nick)+" removed "+std::string(target->nick)+ " from the channel"); @@ -126,7 +132,7 @@ class cmd_remove : public command_t } else { - Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** You do not have access to remove "+std::string(target->nick)+" from the "+std::string(channel->name)); + Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** You do not have access to remove "+std::string(target->nick)+" from "+std::string(channel->name)); } } else |
