--- 2001-03-02 |MrBean| "$Id: ccontrol.help.sql,v 1.17 2008/12/27 23:34:30 hidden1 Exp $"
+-- 2001-03-02 |MrBean| "$Id: ccontrol.help.sql,v 1.18 2009/06/06 07:53:34 hidden1 Exp $"
-- Created the file and added all help topics to the database
-- 2201-03-11 |MrBean|
EXCEPTIONS 5 <connections> - number of connections allowed before gline/warning
FORCECHANGLINE 1 ****** FORCECHANGLINE COMMAND ******
FORCECHANGLINE 2 Glines all users on the given channel
-FORCECHANGLINE 3 Syntax: /msg $BOT$ forcechangline <#channel> [duration] <reason>
+FORCECHANGLINE 3 Syntax: /msg $BOT$ forcechangline [-u] <#channel> [duration] <reason>
FORCECHANGLINE 4 <#channel> - the channel name to gline
FORCECHANGLINE 5 [duration] - Duration of the gline, may have s,m,h,d for secs,mins,hours,days
FORCECHANGLINE 6 <reason> - reason for the gline
-FORCECHANGLINE 7 This type of chan gline is limited for 24 hours and cannot be issued on channels with opers or channels which are marked as nomode channels
+FORCECHANGLINE 7 [-u] - only glines the unidented clients found on the channel with ~*@IP glines
+FORCECHANGLINE 8 This type of chan gline is limited for 24 hours and cannot be issued on channels with opers or channels which are marked as nomode channels
FORCEGLINE 1 ****** FORCEGLINE COMMAND ******
FORCEGLINE 2 Glines a host for a certain amount of time
FORCEGLINE 3 Syntax: /msg $BOT$ forcegline [-fu] <nick|user@host> <duration[s/m/h/d]> <reason>
SCANGLINE 4 <host mask> - the host mask to lookup
SCHANGLINE 1 ****** SCHANGLINE COMMAND ******
SCHANGLINE 2 Glines all users on the given channel
-SCHANGLINE 3 Syntax: /msg $BOT$ schangline <#channel> [duration] <reason>
+SCHANGLINE 3 Syntax: /msg $BOT$ schangline [-u] <#channel> [duration] <reason>
SCHANGLINE 4 <#channel> - the channel name to gline
SCHANGLINE 5 [duration] - Duration of the gline, may have s,m,h,d for secs,mins,hours,days
SCHANGLINE 6 <reason> - reason for the gline
+SCHANGLINE 7 [-u] - only glines the unidented clients found on the channel with ~*@IP glines
SGLINE 1 ****** SGLINE COMMAND ******
SGLINE 2 gline a user@host with relaxed restrictions
SGLINE 3 Syntax: /msg $BOT$ sgline <user@host> [duration] <reason>
SGLINE 4 <user@host> - the user@host to gline from the network
SGLINE 5 [duration] - duration of the gline, supports s,m,h,d for secs,mins,hours,days
SGLINE 6 <reason> - reason for the gline
+SHELLS 1 ****** SHELLS COMMAND ******
+SHELLS 2 Add/remove/modify shells limits/exceptions
+SHELLS 3 Syntax: /msg $BOT$ SHELLS <addcompany|addnetblock|delcompany|delnetblock|list|chlimit|chname|clearall> <Shell company|Netblock> <max connections>
+SHELLS 4 <Shell company>: The name of the shell company
+SHELLS 5 <Netblock>: CIDR netblock
+SHELLS 6 <max connections>: The number of connections allowed before gline
SHUTDOWN 1 ****** SHUTDOWN COMMAND ******
SHUTDOWN 2 Shutdown the service and exit
SHUTDOWN 3 Syntax: /msg $BOT$ shutdown <reason>
WHOIS 2 Gives information about a user on the network
WHOIS 3 Syntax: /msg $BOT$ whois <nick>
WHOIS 4 <nick> - the person you want to get info about
-SHELLS 1 ****** SHELLS COMMAND ******
-SHELLS 2 Add/remove/modify shells limits/exceptions
-SHELLS 3 Syntax: /msg $BOT$ SHELLS <addcompany|addnetblock|delcompany|delnetblock|list|chlimit|chname|clearall> <Shell company|Netblock> <max connections>
-SHELLS 4 <Shell company>: The name of the shell company
-SHELLS 5 <Netblock>: CIDR netblock
-SHELLS 6 <max connections>: The number of connections allowed before gline
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: FORCECHANGLINECommand.cc,v 1.4 2009/05/16 07:47:23 danielaustin Exp $
+ * $Id: FORCECHANGLINECommand.cc,v 1.5 2009/06/06 07:53:34 hidden1 Exp $
*/
#include <string>
#include "Constants.h"
#include "gnuworld_config.h"
-RCSTAG( "$Id: FORCECHANGLINECommand.cc,v 1.4 2009/05/16 07:47:23 danielaustin Exp $" ) ;
+RCSTAG( "$Id: FORCECHANGLINECommand.cc,v 1.5 2009/06/06 07:53:34 hidden1 Exp $" ) ;
namespace gnuworld
{
const int MAX_CHANGLINE_LENGTH = 24*3600;
StringTokenizer st(Message);
unsigned int ResStart = 2;
+ int uParam = 0; // if the -u paramter is used in the command, it will only gline unidented connections
if (st.size() < 4)
{
return true;
}
+ if (st[1] == "-u") {
+ if (st.size() < 5) {
+ Usage(theClient);
+ return true;
+ }
+ uParam = 1;
+ }
+
StringTokenizer::size_type pos = 1;
time_t gLength = bot->getDefaultGlineLength();
ccUser* tmpUser = bot->IsAuth(theClient);
bot->MsgChanLog("FORCECHANGLINE %s\n",st.assemble(1).c_str());
/* make sure they're trying a channel gline! */
- if (st[pos].substr(0,1) != "#")
+ if (st[pos+uParam].substr(0,1) != "#")
{
bot->Notice(theClient,"Umm... this is CHANGLINE, not GLINE - Try "
"glining a channel maybe?");
return true;
}
- if (IsTimeSpec(st[2]))
+ if (IsTimeSpec(st[2+uParam]))
{
- gLength = extractTime( st[2], 1 );
+ gLength = extractTime( st[2+uParam], 1 );
} else {
gLength = bot->getDefaultGlineLength();
ResStart = 1;
return false;
}
- if (st[1].size() > channel::MaxName)
+ if (st[1+uParam].size() > channel::MaxName)
{
bot->Notice(theClient,"Channel name can't be more than %d "
"characters", channel::MaxName);
return false;
}
- if(bot->isBadChannel(st[1]) != NULL)
+ if(bot->isBadChannel(st[1+uParam]) != NULL)
{
bot->Notice(theClient,"You cant gline a nomode channel");
return false;
}
- Channel* theChan = Network->findChannel(st[1]);
+ Channel* theChan = Network->findChannel(st[1+uParam]);
if (NULL == theChan)
{
bot->Notice(theClient, "Unable to find channel %s",
- st[1].c_str());
+ st[1+uParam].c_str());
return true;
}
- StringTokenizer reason(st.assemble(pos + ResStart), '|');
+ StringTokenizer reason(st.assemble(pos + ResStart + uParam), '|');
- if(!bot->glineChannelUsers(theClient, theChan, reason[0], gLength, nickUserHost,true))
+ if(!bot->glineChannelUsers(theClient, theChan, reason[0], gLength, nickUserHost,true,uParam))
{
bot->Notice(theClient, "You cant gline a channel which has an oper in it");
}
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: SCHANGLINECommand.cc,v 1.4 2009/05/16 07:47:23 danielaustin Exp $
+ * $Id: SCHANGLINECommand.cc,v 1.5 2009/06/06 07:53:34 hidden1 Exp $
*/
#include <string>
#include "Constants.h"
#include "gnuworld_config.h"
-RCSTAG( "$Id: SCHANGLINECommand.cc,v 1.4 2009/05/16 07:47:23 danielaustin Exp $" ) ;
+RCSTAG( "$Id: SCHANGLINECommand.cc,v 1.5 2009/06/06 07:53:34 hidden1 Exp $" ) ;
namespace gnuworld
{
{
StringTokenizer st(Message);
unsigned ResStart = 2;
+ int uParam = 0; // if the -u paramter is used in the command, it will only gline unidented connections
if (st.size() < 4)
{
return true;
}
+ if (st[1] == "-u") {
+ if (st.size() < 5) {
+ Usage(theClient);
+ return true;
+ }
+ uParam = 1;
+ }
+
StringTokenizer::size_type pos = 1;
time_t gLength = bot->getDefaultGlineLength();
ccUser* tmpUser = bot->IsAuth(theClient);
bot->MsgChanLog("SCHANGLINE %s\n",st.assemble(1).c_str());
/* make sure they're trying a channel gline! */
- if (st[pos].substr(0,1) != "#")
+ if (st[pos+uParam].substr(0,1) != "#")
{
bot->Notice(theClient,"Umm... this is SCHANGLINE, not GLINE - Try "
"glining a channel maybe?");
return true;
}
- if (IsTimeSpec(st[2]))
+ if (IsTimeSpec(st[2+uParam]))
{
- gLength = extractTime( st[2], 1 );
+ gLength = extractTime( st[2+uParam], 1 );
} else {
gLength = bot->getDefaultGlineLength();
ResStart = 1;
return false;
}
- if (st[1].size() > channel::MaxName)
+ if (st[1+uParam].size() > channel::MaxName)
{
bot->Notice(theClient,"Channel name can't be more than %d "
"characters", channel::MaxName);
return false;
}
- Channel* theChan = Network->findChannel(st[1]);
+ Channel* theChan = Network->findChannel(st[1+uParam]);
if (NULL == theChan)
{
bot->Notice(theClient, "Unable to find channel %s",
- st[1].c_str());
+ st[1+uParam].c_str());
return true;
}
- StringTokenizer reason(st.assemble ( pos + ResStart), '|');
+ StringTokenizer reason(st.assemble ( pos + ResStart + uParam), '|');
- bot->glineChannelUsers(theClient, theChan, reason[0], gLength, nickUserHost, false);
+ bot->glineChannelUsers(theClient, theChan, reason[0], gLength, nickUserHost, false, uParam);
return true;
}
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: ccontrol.cc,v 1.226 2009/05/31 21:31:55 hidden1 Exp $
+ * $Id: ccontrol.cc,v 1.227 2009/06/06 07:53:34 hidden1 Exp $
*/
#define MAJORVER "1"
#include "ccontrol_generic.h"
#include "gnuworld_config.h"
-RCSTAG( "$Id: ccontrol.cc,v 1.226 2009/05/31 21:31:55 hidden1 Exp $" ) ;
+RCSTAG( "$Id: ccontrol.cc,v 1.227 2009/06/06 07:53:34 hidden1 Exp $" ) ;
namespace gnuworld
{
operLevel::OPERLEVEL,
false ) ) ;
RegisterCommand( new SCHANGLINECommand( this, "SCHANGLINE",
- "<#channel> <duration>[time units (s,d,h)] <reason> "
+ "[-u] <#channel> <duration>[time units (s,d,h)] <reason> "
"Gline a given channel for the given reason",
true,
commandLevel::flg_SCHANGLINE,
operLevel::CODERLEVEL,
true ) ) ;
RegisterCommand( new FORCECHANGLINECommand( this, "FORCECHANGLINE",
- "<#channel> <duration>[time units (s,d,h)] <reason> "
+ "[-u] <#channel> <duration>[time units (s,d,h)] <reason> "
"Gline a given channel for the given reason",
true,
commandLevel::flg_FORCECHANGLINE,
badChannelsMap.erase(badChannelsMap.find(Channel->getName()));
}
-bool ccontrol::glineChannelUsers(iClient* theClient, Channel* theChan, const string& reason, unsigned int gLength, const string& addedBy,bool excludeChanWithOper)
+bool ccontrol::glineChannelUsers(iClient* theClient, Channel* theChan, const string& reason, unsigned int gLength, const string& addedBy,bool excludeChanWithOper,bool unidented)
{
ccGline *TmpGline;
iClient *TmpClient;
foundException = true;
Notice(theClient, "There is an exception for this user: %s!%s@%s", TmpClient->getNickName().c_str(), TmpClient->getUserName().c_str(), curIP.c_str());
}
+ if ((unidented) && (TmpClient->getUserName().substr(0,1)) != "~")
+ continue;
gptr = glineList.find("*@" + curIP);
if (gptr != glineList.end())
{
/* create a new gline and queue it */
TmpGline = new ccGline(SQLDb);
assert(TmpGline != NULL);
- TmpGline->setHost("*@" + curIP);
+ if (unidented)
+ TmpGline->setHost("~*@" + curIP);
+ else
+ TmpGline->setHost("*@" + curIP);
TmpGline->setExpires(unsigned(gLength));
TmpGline->setAddedBy(addedBy);
TmpGline->setReason(reason);
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
- * $Id: ccontrol.h,v 1.108 2009/05/31 21:31:55 hidden1 Exp $
+ * $Id: ccontrol.h,v 1.109 2009/06/06 07:53:34 hidden1 Exp $
*/
#ifndef __CCONTROL_H
-#define __CCONTROL_H "$Id: ccontrol.h,v 1.108 2009/05/31 21:31:55 hidden1 Exp $"
+#define __CCONTROL_H "$Id: ccontrol.h,v 1.109 2009/06/06 07:53:34 hidden1 Exp $"
//Undef this if you want to log to the database
#define LOGTOHD
bool updateMisc(const string&, const unsigned int);
- bool glineChannelUsers(iClient* , Channel* , const string& , unsigned int , const string& , bool);
+ bool glineChannelUsers(iClient* , Channel* , const string& , unsigned int , const string& , bool, bool);
/**
* This is a constant iterator type used to perform a read-only