From 3bdd25e560f7c97433ceab0f09810f2be36bf131 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 24 Jun 2006 18:00:35 +0000 Subject: 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 --- src/modules/m_remove.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/modules/m_remove.cpp') 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 -- cgit v1.3.1-10-gc9f91