#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
{
namespace cf
{
-void ADDFLAGCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void ADDFLAGCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
return;
}
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
return;
}
-if (flag == bot->getFlagChar(sqlUser::F_OWNER) &&
- !theUser->getFlag(sqlUser::F_OWNER)) {
+if (flag == bot->getFlagChar(sqlcfUser::F_OWNER) &&
+ !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::owner_add_owner_only,
return;
}
-if (flag == bot->getFlagChar(sqlUser::F_USERMANAGER) &&
- !theUser->getFlag(sqlUser::F_OWNER)) {
+if (flag == bot->getFlagChar(sqlcfUser::F_USERMANAGER) &&
+ !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::user_man_add_owner_only,
}
/* A serveradmin can only add flags to users on his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
std::string("You cannot add a flag to a user in a different group.")).c_str());
return;
}
- if (flag == bot->getFlagChar(sqlUser::F_BLOCK)) {
+ if (flag == bot->getFlagChar(sqlcfUser::F_BLOCK)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_add_block_flag,
std::string("You cannot add a block flag.")).c_str());
return;
}
- if (flag == bot->getFlagChar(sqlUser::F_SERVERADMIN)) {
+ if (flag == bot->getFlagChar(sqlcfUser::F_SERVERADMIN)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_add_serveradmin_flag,
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
{
namespace cf
{
-void ADDHOSTCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void ADDHOSTCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
}
/* Can't add a host to an owner unless you're an owner. */
-if (targetUser->getFlag(sqlUser::F_OWNER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_OWNER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_add_host_an_owner,
}
/* Can only add a host to a user manager if you're an owner. */
-if (targetUser->getFlag(sqlUser::F_USERMANAGER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_USERMANAGER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_add_host_manager,
}
/* A serveradmin can only add hosts to users on his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
{
namespace cf
{
-void ADDNOTECommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void ADDNOTECommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
{
namespace cf
{
-void ADDUSERCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void ADDUSERCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
return;
}
-sqlUser *newUser = new sqlUser(bot->theManager);
+sqlcfUser *newUser = new sqlcfUser(bot->theManager);
assert(newUser != 0);
newUser->setUserName(st[1]);
newUser->setCreated(bot->currentTime());
+ theClient->getRealNickUserHost() ) );
/* A user added by a serveradmin automatically has the same group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER))
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER))
newUser->setGroup(theUser->getGroup());
else
newUser->setGroup("undernet.org");
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void ALERTCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void ALERTCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void BLOCKCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void BLOCKCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void CANFIXCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void CANFIXCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void CHANFIXCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void CHANFIXCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void CHECKCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void CHECKCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void DEBUGCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void DEBUGCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
#ifndef CHANFIX_DEBUG
return;
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void DELFLAGCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void DELFLAGCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
return;
}
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
return;
}
-if (flag == bot->getFlagChar(sqlUser::F_OWNER) &&
- !theUser->getFlag(sqlUser::F_OWNER)) {
+if (flag == bot->getFlagChar(sqlcfUser::F_OWNER) &&
+ !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::only_owner_del_owner_flag,
return;
}
-if (flag == bot->getFlagChar(sqlUser::F_USERMANAGER) &&
- !theUser->getFlag(sqlUser::F_OWNER)) {
+if (flag == bot->getFlagChar(sqlcfUser::F_USERMANAGER) &&
+ !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::only_owner_del_user_flag,
}
/* A serveradmin can only delete flags from users on his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
std::string("You cannot delete a flag from a user in a different group.")).c_str());
return;
}
- if (flag == bot->getFlagChar(sqlUser::F_BLOCK)) {
+ if (flag == bot->getFlagChar(sqlcfUser::F_BLOCK)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_remove_block_flag,
std::string("You cannot remove a block flag.")).c_str());
return;
}
- if (flag == bot->getFlagChar(sqlUser::F_SERVERADMIN)) {
+ if (flag == bot->getFlagChar(sqlcfUser::F_SERVERADMIN)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_remove_server_flag,
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void DELHOSTCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void DELHOSTCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
}
/* Can't delete a host from an owner unless you're an owner. */
-if (targetUser->getFlag(sqlUser::F_OWNER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_OWNER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_del_host_an_owner,
}
/* Can only delete a host from a user manager if you're an owner. */
-if (targetUser->getFlag(sqlUser::F_USERMANAGER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_USERMANAGER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_del_host_manager,
}
/* A serveradmin can only add flags to users on his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void DELNOTECommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void DELNOTECommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
return;
}
-if (string_lower(user_name) != string_lower(theUser->getUserName()) && !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (string_lower(user_name) != string_lower(theUser->getUserName()) && !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::note_not_added_by_you,
return;
}
-if (eventType != sqlChannel::EV_NOTE && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (eventType != sqlChannel::EV_NOTE && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::note_not_manually_added,
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void DELUSERCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void DELUSERCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
}
/* Can't delete an owner unless you're an owner. */
-if (targetUser->getFlag(sqlUser::F_OWNER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_OWNER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_delete_an_owner,
}
/* Can only delete a user manager if you're an owner. */
-if (targetUser->getFlag(sqlUser::F_USERMANAGER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_USERMANAGER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_delete_manager,
}
/* A serveradmin can only delete users in his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
#include "chanfixCommands.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void HELPCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void HELPCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXLOGGEDIN>"));
- if (theUser->getFlag(sqlUser::F_SERVERADMIN))
+ if (theUser->getFlag(sqlcfUser::F_SERVERADMIN))
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXSERVERADMIN>"));
- if (theUser->getFlag(sqlUser::F_BLOCK))
+ if (theUser->getFlag(sqlcfUser::F_BLOCK))
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXBLOCK>"));
- if (theUser->getFlag(sqlUser::F_COMMENT))
+ if (theUser->getFlag(sqlcfUser::F_COMMENT))
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXCOMMENT>"));
- if (theUser->getFlag(sqlUser::F_CHANFIX))
+ if (theUser->getFlag(sqlcfUser::F_CHANFIX))
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXCHANFIX>"));
- if (theUser->getFlag(sqlUser::F_OWNER))
+ if (theUser->getFlag(sqlcfUser::F_OWNER))
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXOWNER>"));
- if (theUser->getFlag(sqlUser::F_USERMANAGER))
+ if (theUser->getFlag(sqlcfUser::F_USERMANAGER))
bot->SendTo(theClient, bot->getHelpMessage(theUser, "<INDEXUSERADMIN>"));
} else {
if (real) {
/* If you change this code, remember to change it in chanfix.cc */
- sqlUser::flagType requiredFlags = commHandler->second->getRequiredFlags();
+ sqlcfUser::flagType requiredFlags = commHandler->second->getRequiredFlags();
if (requiredFlags) {
- if (requiredFlags == sqlUser::F_LOGGEDIN)
+ if (requiredFlags == sqlcfUser::F_LOGGEDIN)
bot->SendTo(theClient, "This command requires authentication.");
else {
if (bot->getFlagChar(requiredFlags) != ' ')
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void HISTORYCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void HISTORYCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void INFOCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void INFOCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void INVITECommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void INVITECommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "sqlChanOp.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
#include "Network.h"
#include "iClient.h"
namespace cf
{
-void LASTCOMCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void LASTCOMCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st( Message ) ;
unsigned int NumOfCom;
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
{
namespace cf
{
-void LISTBLOCKEDCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void LISTBLOCKEDCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
/* Check if channel blocking has been disabled in the config. */
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void LISTHOSTSCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void LISTHOSTSCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser;
+sqlcfUser* targetUser;
if (st.size() == 2)
targetUser = bot->isAuthed(st[1]);
else
return;
}
-sqlUser::flagType requiredFlags = sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN;
+sqlcfUser::flagType requiredFlags = sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN;
if ((targetUser != theUser) && !theUser->getFlag(requiredFlags)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
}
/* A serveradmin can only view hosts of users in his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
std::string("Host list for %s:")).c_str(),
targetUser->getUserName().c_str());
-sqlUser::hostListType sqlHostList = targetUser->getHostList();
+sqlcfUser::hostListType sqlHostList = targetUser->getHostList();
if (!sqlHostList.empty()) {
- for (sqlUser::hostListType::iterator itr = sqlHostList.begin();
+ for (sqlcfUser::hostListType::iterator itr = sqlHostList.begin();
itr != sqlHostList.end(); ++itr)
bot->SendTo(theClient, *itr);
} else {
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id: LISTBLOCKEDCommand.cc 1553 2006-04-18 04:03:59Z sirvulcan $");
{
namespace cf
{
-void LISTTEMPBLOCKEDCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void LISTTEMPBLOCKEDCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
int numBlocks = 0;
sqlChanOp.cc \
sqlChannel.cc \
sqlManager.cc \
- sqlUser.cc
+ sqlcfUser.cc
libchanfix_la_CXXFLAGS = -I$(PGSQL_INCLUDE) -I${top_srcdir}/include \
-I${top_srcdir}/libgnuworld \
sqlChanOp.h \
sqlChannel.h \
sqlManager.h \
- sqlUser.h \
+ sqlcfUser.h \
$(COMMAND_CONF)
confdir=${prefix}/bin
libchanfix_la-USETCommand.lo libchanfix_la-WHOGROUPCommand.lo \
libchanfix_la-WHOISCommand.lo libchanfix_la-sqlChanOp.lo \
libchanfix_la-sqlChannel.lo libchanfix_la-sqlManager.lo \
- libchanfix_la-sqlUser.lo
+ libchanfix_la-sqlcfUser.lo
libchanfix_la_OBJECTS = $(am_libchanfix_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
sqlChanOp.cc \
sqlChannel.cc \
sqlManager.cc \
- sqlUser.cc
+ sqlcfUser.cc
libchanfix_la_CXXFLAGS = -I$(PGSQL_INCLUDE) -I${top_srcdir}/include \
-I${top_srcdir}/libgnuworld \
sqlChanOp.h \
sqlChannel.h \
sqlManager.h \
- sqlUser.h \
+ sqlcfUser.h \
$(COMMAND_CONF)
confdir = ${prefix}/bin
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-sqlChanOp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-sqlChannel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-sqlManager.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-sqlUser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libchanfix_la-sqlcfUser.Plo@am__quote@
.cc.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -c -o libchanfix_la-sqlManager.lo `test -f 'sqlManager.cc' || echo '$(srcdir)/'`sqlManager.cc
-libchanfix_la-sqlUser.lo: sqlUser.cc
-@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -MT libchanfix_la-sqlUser.lo -MD -MP -MF "$(DEPDIR)/libchanfix_la-sqlUser.Tpo" -c -o libchanfix_la-sqlUser.lo `test -f 'sqlUser.cc' || echo '$(srcdir)/'`sqlUser.cc; \
-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libchanfix_la-sqlUser.Tpo" "$(DEPDIR)/libchanfix_la-sqlUser.Plo"; else rm -f "$(DEPDIR)/libchanfix_la-sqlUser.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='sqlUser.cc' object='libchanfix_la-sqlUser.lo' libtool=yes @AMDEPBACKSLASH@
+libchanfix_la-sqlcfUser.lo: sqlcfUser.cc
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -MT libchanfix_la-sqlcfUser.lo -MD -MP -MF "$(DEPDIR)/libchanfix_la-sqlcfUser.Tpo" -c -o libchanfix_la-sqlcfUser.lo `test -f 'sqlcfUser.cc' || echo '$(srcdir)/'`sqlcfUser.cc; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libchanfix_la-sqlcfUser.Tpo" "$(DEPDIR)/libchanfix_la-sqlcfUser.Plo"; else rm -f "$(DEPDIR)/libchanfix_la-sqlcfUser.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='sqlcfUser.cc' object='libchanfix_la-sqlcfUser.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -c -o libchanfix_la-sqlUser.lo `test -f 'sqlUser.cc' || echo '$(srcdir)/'`sqlUser.cc
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libchanfix_la_CXXFLAGS) $(CXXFLAGS) -c -o libchanfix_la-sqlcfUser.lo `test -f 'sqlcfUser.cc' || echo '$(srcdir)/'`sqlcfUser.cc
mostlyclean-libtool:
-rm -f *.lo
namespace cf
{
-void OPLISTCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void OPLISTCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void OPNICKSCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void OPNICKSCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void QUOTECommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void QUOTECommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
#ifndef ENABLE_QUOTE
return;
namespace cf
{
-void REHASHCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void REHASHCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void RELOADCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void RELOADCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void REQUESTOPCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void REQUESTOPCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void SAYCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SAYCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "StringTokenizer.h"
#include "sqlChannel.h"
#include "sqlChanOp.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void SCORECommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SCORECommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void SETCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SETCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void SETGROUPCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SETGROUPCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
namespace cf
{
-void SHUTDOWNCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SHUTDOWNCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id: SIMULATECommand.cc 1523 2006-03-23 23:33:47Z r33d $");
namespace cf
{
-void SIMULATECommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SIMULATECommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
namespace cf
{
-void STATUSCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void STATUSCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
bot->SendTo(theClient, "[evilnet development's GNUWorld %s]",
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void SUSPENDCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void SUSPENDCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
}
/* Can't suspend an owner unless you're an owner. */
-if (targetUser->getFlag(sqlUser::F_OWNER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_OWNER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_suspend_an_owner,
}
/* Can only suspend a user manager if you're an owner. */
-if (targetUser->getFlag(sqlUser::F_USERMANAGER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_USERMANAGER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_suspend_manager,
/* A serveradmin can only suspend users in his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id: BLOCKCommand.cc 1553 2006-04-18 04:03:59Z sirvulcan $");
namespace cf
{
-void TEMPBLOCKCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void TEMPBLOCKCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void UNALERTCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void UNALERTCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void UNBLOCKCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void UNBLOCKCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void UNSUSPENDCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void UNSUSPENDCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
-sqlUser* targetUser = bot->isAuthed(st[1]);
+sqlcfUser* targetUser = bot->isAuthed(st[1]);
if (!targetUser) {
bot->SendTo(theClient,
bot->getResponse(theUser,
}
/* Can't unsuspend an owner unless you're an owner. */
-if (targetUser->getFlag(sqlUser::F_OWNER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_OWNER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_unsuspend_an_owner,
}
/* Can only unsuspend a user manager if you're an owner. */
-if (targetUser->getFlag(sqlUser::F_USERMANAGER) && !theUser->getFlag(sqlUser::F_OWNER)) {
+if (targetUser->getFlag(sqlcfUser::F_USERMANAGER) && !theUser->getFlag(sqlcfUser::F_OWNER)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
language::cant_unsuspend_manager,
}
/* A serveradmin can only unsuspend users in his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (targetUser->getGroup() != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id: UNBLOCKCommand.cc 1553 2006-04-18 04:03:59Z sirvulcan $");
namespace cf
{
-void UNTEMPBLOCKCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void UNTEMPBLOCKCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "responses.h"
#include "StringTokenizer.h"
#include "sqlChanOp.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void USERSCORESCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void USERSCORESCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
#include "chanfix.h"
#include "responses.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void USETCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void USETCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
std::string value;
if (st.size() == 4) {
- sqlUser* targetUser = bot->isAuthed(st[1]);
+ sqlcfUser* targetUser = bot->isAuthed(st[1]);
option = string_upper(st[2]);
value = string_upper(st[3]);
- sqlUser::flagType requiredFlags;
+ sqlcfUser::flagType requiredFlags;
if (option == "NEEDOPER") {
- requiredFlags = sqlUser::F_USERMANAGER;
+ requiredFlags = sqlcfUser::F_USERMANAGER;
if (!theUser->getFlag(requiredFlags)) {
bot->SendTo(theClient,
bot->getResponse(theUser,
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void WHOGROUPCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void WHOGROUPCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
}
/* A serveradmin can only WHOGROUP on his/her own group. */
-if (theUser->getFlag(sqlUser::F_SERVERADMIN) &&
- !theUser->getFlag(sqlUser::F_USERMANAGER)) {
+if (theUser->getFlag(sqlcfUser::F_SERVERADMIN) &&
+ !theUser->getFlag(sqlcfUser::F_USERMANAGER)) {
if (string_lower(st[1]) != theUser->getGroup()) {
bot->SendTo(theClient,
bot->getResponse(theUser,
unsigned int numUsersInGroup = 0;
chanfix::usersIterator ptr = bot->usersMap_begin();
while (ptr != bot->usersMap_end()) {
- sqlUser* tmpUser = ptr->second;
+ sqlcfUser* tmpUser = ptr->second;
if (tmpUser->getGroup() == string_lower(st[1])) {
if (numUsersInGroup++ && !groupUsers.empty())
groupUsers += " ";
#include "chanfix.h"
#include "responses.h"
#include "StringTokenizer.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
RCSTAG("$Id$");
namespace cf
{
-void WHOISCommand::Exec(iClient* theClient, sqlUser* theUser, const std::string& Message)
+void WHOISCommand::Exec(iClient* theClient, sqlcfUser* theUser, const std::string& Message)
{
StringTokenizer st(Message);
std::string("List of all users:")).c_str());
chanfix::usersIterator ptr = bot->usersMap_begin();
while (ptr != bot->usersMap_end()) {
- sqlUser* tmpUser = ptr->second;
+ sqlcfUser* tmpUser = ptr->second;
bot->SendTo(theClient,
bot->getResponse(theUser,
language::user_flags_group,
return;
}
-sqlUser* theUser2 = bot->isAuthed(st[1]);
+sqlcfUser* theUser2 = bot->isAuthed(st[1]);
const char* username = st[1].c_str();
if (username[0] == '=') {
#include "responses.h"
#include "sqlChanOp.h"
#include "sqlChannel.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
#ifdef CHANFIX_HAVE_BOOST_THREAD
#include <boost/thread/thread.hpp>
updateInProgress = false;
std::string dbString = "host=" + sqlHost + " dbname=" + sqlDB
- + " port=" + sqlPort + " user=" + sqlUsername + " password=" + sqlPass;
+ + " port=" + sqlPort + " user=" + sqlcfUsername + " password=" + sqlPass;
theManager = sqlManager::getInstance(dbString);
RegisterCommand(new ADDFLAGCommand(this, "ADDFLAG",
"<username> <flag>",
3,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new ADDHOSTCommand(this, "ADDHOST",
"<username> <nick!user@host>",
3,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new ADDNOTECommand(this, "ADDNOTE",
"<#channel> <reason>",
3,
- sqlUser::F_COMMENT
+ sqlcfUser::F_COMMENT
));
RegisterCommand(new ADDUSERCommand(this, "ADDUSER",
"<username> [host]",
2,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new ALERTCommand(this, "ALERT",
"<#channel> [reason]",
2,
- sqlUser::F_COMMENT
+ sqlcfUser::F_COMMENT
));
RegisterCommand(new BLOCKCommand(this, "BLOCK",
"<#channel> <reason>",
3,
- sqlUser::F_BLOCK
+ sqlcfUser::F_BLOCK
));
RegisterCommand(new CANFIXCommand(this, "CANFIX",
"<#channel>",
RegisterCommand(new CHANFIXCommand(this, "CHANFIX",
"<#channel> [override] [contact]",
2,
- sqlUser::F_CHANFIX
+ sqlcfUser::F_CHANFIX
));
RegisterCommand(new CHECKCommand(this, "CHECK",
"<#channel>",
RegisterCommand(new DEBUGCommand(this, "DEBUG",
"<ROTATE|UPDATE>",
2,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
#endif /* CHANFIX_DEBUG */
RegisterCommand(new DELFLAGCommand(this, "DELFLAG",
"<username> <flag>",
3,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new DELHOSTCommand(this, "DELHOST",
"<username> <nick!user@host>",
3,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new DELNOTECommand(this, "DELNOTE",
"<#channel> <note_id>",
3,
- sqlUser::F_COMMENT
+ sqlcfUser::F_COMMENT
));
RegisterCommand(new DELUSERCommand(this, "DELUSER",
"<username>",
2,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new HELPCommand(this, "HELP",
"[command]",
RegisterCommand(new INVITECommand(this, "INVITE",
"",
1,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new LASTCOMCommand(this, "LASTCOM",
"[amount of commands] [days from]",
1,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new LISTBLOCKEDCommand(this, "LISTBLOCKED",
"",
1,
- sqlUser::F_BLOCK
+ sqlcfUser::F_BLOCK
));
RegisterCommand(new LISTHOSTSCommand(this, "LISTHOSTS",
"[username]",
1,
- sqlUser::F_LOGGEDIN
+ sqlcfUser::F_LOGGEDIN
));
RegisterCommand(new LISTTEMPBLOCKEDCommand(this, "LISTTEMPBLOCKED",
"",
1,
- sqlUser::F_BLOCK
+ sqlcfUser::F_BLOCK
));
RegisterCommand(new OPLISTCommand(this, "OPLIST",
"<#channel> [-all] [-days]",
RegisterCommand(new QUOTECommand(this, "QUOTE",
"<text>",
2,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
#endif /* ENABLE_QUOTE */
RegisterCommand(new REHASHCommand(this, "REHASH",
"",
1,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new RELOADCommand(this, "RELOAD",
"[reason]",
1,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new REQUESTOPCommand(this, "REQUESTOP",
isAllowingTopOpAlert() ? "<#channel> [contact]" : "<#channel>",
RegisterCommand(new SAYCommand(this, "SAY",
"<#channel> <text>",
3,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new SETCommand(this, "SET",
"<option> <value>",
3,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new SETGROUPCommand(this, "SETGROUP",
"<username> <group>",
3,
- sqlUser::F_USERMANAGER
+ sqlcfUser::F_USERMANAGER
));
RegisterCommand(new SIMULATECommand(this, "SIMULATE",
"<#channel> <auto/manual>",
3,
- sqlUser::F_CHANFIX
+ sqlcfUser::F_CHANFIX
));
RegisterCommand(new SHUTDOWNCommand(this, "SHUTDOWN",
"[reason]",
1,
- sqlUser::F_OWNER
+ sqlcfUser::F_OWNER
));
RegisterCommand(new STATUSCommand(this, "STATUS",
"",
RegisterCommand(new SUSPENDCommand(this, "SUSPEND",
"<username>",
2,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new TEMPBLOCKCommand(this, "TEMPBLOCK",
"<#channel>",
2,
- sqlUser::F_BLOCK
+ sqlcfUser::F_BLOCK
));
RegisterCommand(new UNALERTCommand(this, "UNALERT",
"<#channel>",
2,
- sqlUser::F_COMMENT
+ sqlcfUser::F_COMMENT
));
RegisterCommand(new UNBLOCKCommand(this, "UNBLOCK",
"<#channel>",
2,
- sqlUser::F_BLOCK
+ sqlcfUser::F_BLOCK
));
RegisterCommand(new UNSUSPENDCommand(this, "UNSUSPEND",
"<username>",
2,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new UNTEMPBLOCKCommand(this, "UNTEMPBLOCK",
"<#channel>",
2,
- sqlUser::F_BLOCK
+ sqlcfUser::F_BLOCK
));
RegisterCommand(new USERSCORESCommand(this, "USERSCORES",
"<account>",
2,
- sqlUser::F_LOGGEDIN
+ sqlcfUser::F_LOGGEDIN
));
RegisterCommand(new USETCommand(this, "USET",
"[username] <option> <value>",
3,
- sqlUser::F_LOGGEDIN
+ sqlcfUser::F_LOGGEDIN
));
RegisterCommand(new WHOGROUPCommand(this, "WHOGROUP",
"[group]",
1,
- sqlUser::F_USERMANAGER | sqlUser::F_SERVERADMIN
+ sqlcfUser::F_USERMANAGER | sqlcfUser::F_SERVERADMIN
));
RegisterCommand(new WHOISCommand(this, "WHOIS",
"<username|=nick|*> [-modif]",
2,
- sqlUser::F_LOGGEDIN
+ sqlcfUser::F_LOGGEDIN
));
/* Set our current day. */
sqlHost = chanfixConfig->Require("sqlHost")->second;
sqlPort = chanfixConfig->Require("sqlPort")->second;
sqlDB = chanfixConfig->Require("sqlDB")->second;
-sqlUsername = chanfixConfig->Require("sqlUser")->second;
+sqlcfUsername = chanfixConfig->Require("sqlcfUser")->second;
sqlPass = chanfixConfig->Require("sqlPass")->second;
elog << "chanfix::readConfigFile> Configuration loaded!"
void chanfix::OnPrivateMessage( iClient* theClient,
const std::string& Message, bool)
{
-sqlUser* theUser = isAuthed(theClient->getAccount());
+sqlcfUser* theUser = isAuthed(theClient->getAccount());
if (currentState == BURST) {
if (theUser)
}
/* If you change this code, remember to change it in HELPCommand.cc */
-sqlUser::flagType requiredFlags = commHandler->second->getRequiredFlags();
+sqlcfUser::flagType requiredFlags = commHandler->second->getRequiredFlags();
if (requiredFlags) {
if (!theUser) {
SendTo(theClient,
return;
}
- if (requiredFlags != sqlUser::F_LOGGEDIN &&
+ if (requiredFlags != sqlcfUser::F_LOGGEDIN &&
!theUser->getFlag(requiredFlags)) {
if (getFlagChar(requiredFlags) != ' ')
SendTo(theClient,
void chanfix::SendTo(iClient* theClient, const std::string& theMessage)
{
-sqlUser* theUser = isAuthed(theClient->getAccount());
+sqlcfUser* theUser = isAuthed(theClient->getAccount());
if (theUser && !theUser->getUseNotice())
Message(theClient, theMessage);
char *b = buffer ;
const char *m = 0 ;
-sqlUser* theUser = isAuthed(theClient->getAccount());
+sqlcfUser* theUser = isAuthed(theClient->getAccount());
for (m = theMessage.c_str(); *m != 0; m++) {
if (*m == '\n' || *m == '\r') {
vsprintf( buffer, Msg, list ) ;
va_end( list ) ;
-sqlUser* theUser = isAuthed(theClient->getAccount());
+sqlcfUser* theUser = isAuthed(theClient->getAccount());
if (theUser && !theUser->getUseNotice())
Message(theClient, "%s", buffer);
usersMap.clear();
for (int i = 0; i < cacheCon->Tuples(); ++i) {
- sqlUser *newUser = new sqlUser(theManager);
+ sqlcfUser *newUser = new sqlcfUser(theManager);
assert(newUser != 0);
newUser->setAllMembers(cacheCon, i);
return countMyOps(theChan->getName());
}
-const std::string chanfix::getHostList( sqlUser* User)
+const std::string chanfix::getHostList( sqlcfUser* User)
{
/* Get a connection instance to our backend */
PgDatabase* cacheCon = theManager->getConnection();
return;
}
-bool chanfix::simFix(sqlChannel* sqlChan, bool autofix, time_t c_Time, iClient* theClient, sqlUser* theUser)
+bool chanfix::simFix(sqlChannel* sqlChan, bool autofix, time_t c_Time, iClient* theClient, sqlcfUser* theUser)
{
if (sqlChan->getSimStart() == 0) sqlChan->setSimStart(c_Time);
sqlChan->setLastSimAttempt(c_Time);
return false;
}
-bool chanfix::simulateFix(sqlChannel* sqlChan, bool autofix, iClient* theClient, sqlUser* theUser)
+bool chanfix::simulateFix(sqlChannel* sqlChan, bool autofix, iClient* theClient, sqlcfUser* theUser)
{
bool isFixed = false;
time_t t = getNextFix();
time_t end_fix = t + 86400; /* 1 Day */
time_t next_fix = t + PROCESS_QUEUE_TIME;
+ sqlChan->setSimStart(0);
+ sqlChan->setLastSimAttempt(0);
+ sqlChan->setAmountSimOpped(0);
+ sqlChan->setSimModesRemoved(false);
+
/* Modes are always removed straight when a CHANFIX command is issued
for a channel (manual fix). */
if (autofix == false)
return ptm->tm_hour;
}
-sqlUser* chanfix::isAuthed(const std::string Name)
+sqlcfUser* chanfix::isAuthed(const std::string Name)
{
//Name = escapeSQLChars(Name);
-sqlUser* tempUser = usersMap[Name];
+sqlcfUser* tempUser = usersMap[Name];
if (!tempUser)
usersMap.erase(usersMap.find(Name));
return tempUser;
return;
} //giveAllOpsPoints
-char chanfix::getFlagChar(const sqlUser::flagType& whichFlag)
+char chanfix::getFlagChar(const sqlcfUser::flagType& whichFlag)
{
- if (whichFlag == sqlUser::F_SERVERADMIN)
+ if (whichFlag == sqlcfUser::F_SERVERADMIN)
return 'a';
- else if (whichFlag == sqlUser::F_BLOCK)
+ else if (whichFlag == sqlcfUser::F_BLOCK)
return 'b';
- else if (whichFlag == sqlUser::F_COMMENT)
+ else if (whichFlag == sqlcfUser::F_COMMENT)
return 'c';
- else if (whichFlag == sqlUser::F_CHANFIX)
+ else if (whichFlag == sqlcfUser::F_CHANFIX)
return 'f';
- else if (whichFlag == sqlUser::F_OWNER)
+ else if (whichFlag == sqlcfUser::F_OWNER)
return 'o';
- else if (whichFlag == sqlUser::F_USERMANAGER)
+ else if (whichFlag == sqlcfUser::F_USERMANAGER)
return 'u';
else
return ' ';
}
-const std::string chanfix::getFlagsString(const sqlUser::flagType& whichFlags)
+const std::string chanfix::getFlagsString(const sqlcfUser::flagType& whichFlags)
{
std::string flagstr;
- if (whichFlags & sqlUser::F_SERVERADMIN)
+ if (whichFlags & sqlcfUser::F_SERVERADMIN)
flagstr += "a";
- if (whichFlags & sqlUser::F_BLOCK)
+ if (whichFlags & sqlcfUser::F_BLOCK)
flagstr += "b";
- if (whichFlags & sqlUser::F_COMMENT)
+ if (whichFlags & sqlcfUser::F_COMMENT)
flagstr += "c";
- if (whichFlags & sqlUser::F_CHANFIX)
+ if (whichFlags & sqlcfUser::F_CHANFIX)
flagstr += "f";
- if (whichFlags & sqlUser::F_OWNER)
+ if (whichFlags & sqlcfUser::F_OWNER)
flagstr += "o";
- if (whichFlags & sqlUser::F_USERMANAGER)
+ if (whichFlags & sqlcfUser::F_USERMANAGER)
flagstr += "u";
return flagstr;
}
-sqlUser::flagType chanfix::getFlagType(const char whichChar)
+sqlcfUser::flagType chanfix::getFlagType(const char whichChar)
{
switch (whichChar) {
- case 'a': return sqlUser::F_SERVERADMIN;
- case 'b': return sqlUser::F_BLOCK;
- case 'c': return sqlUser::F_COMMENT;
- case 'f': return sqlUser::F_CHANFIX;
- case 'o': return sqlUser::F_OWNER;
- case 'u': return sqlUser::F_USERMANAGER;
+ case 'a': return sqlcfUser::F_SERVERADMIN;
+ case 'b': return sqlcfUser::F_BLOCK;
+ case 'c': return sqlcfUser::F_COMMENT;
+ case 'f': return sqlcfUser::F_CHANFIX;
+ case 'o': return sqlcfUser::F_OWNER;
+ case 'u': return sqlcfUser::F_USERMANAGER;
}
return 0;
}
return "";
}
-const std::string chanfix::getHelpMessage(sqlUser* theUser, std::string topic)
+const std::string chanfix::getHelpMessage(sqlcfUser* theUser, std::string topic)
{
int lang_id = 1;
return;
}
-const std::string chanfix::getResponse( sqlUser* theUser,
+const std::string chanfix::getResponse( sqlcfUser* theUser,
int response_id, std::string msg )
{
MsgChanLog("Attempting to reconnect, Attempt %d out of %d\n",
connectCount+1,connectRetry+1);
std::string Query = "host=" + sqlHost + " dbname=" + sqlDB + " port=" + sqlPort;
- if (strcasecmp(sqlUser,"''"))
- Query += (" user=" + sqlUser);
+ if (strcasecmp(sqlcfUser,"''"))
+ Query += (" user=" + sqlcfUser);
if (strcasecmp(sqlPass,"''"))
Query += (" password=" + sqlPass);
theManager = new (std::nothrow) cmDatabase(Query.c_str());
void Command::Usage( iClient* theClient )
{
-sqlUser* theUser = bot->isAuthed(theClient->getAccount());
+sqlcfUser* theUser = bot->isAuthed(theClient->getAccount());
bot->SendTo(theClient,
bot->getResponse(theUser,
language::syntax,
# Name of database
sqlDB = chanfix
# If you don't need user/pass just put "" for option(s) below
-sqlUser = evilnet
+sqlcfUser = evilnet
sqlPass = ""
# ---------------------------------------------------------------------
#include "sqlChanOp.h"
#include "sqlManager.h"
-#include "sqlUser.h"
+#include "sqlcfUser.h"
namespace gnuworld
{
size_t countMyOps(const std::string&);
size_t countMyOps(Channel*);
- sqlUser* isAuthed(const std::string);
+ sqlcfUser* isAuthed(const std::string);
void precacheChanOps();
void precacheChannels();
bool chanfix::findop(sqlChanOp*, sqlChannel*);
void chanfix::removechan(sqlChannel*);
- bool simFix(sqlChannel*, bool, time_t, iClient*, sqlUser*);
- bool simulateFix(sqlChannel*, bool, iClient*, sqlUser*);
+ bool simFix(sqlChannel*, bool, time_t, iClient*, sqlcfUser*);
+ bool simulateFix(sqlChannel*, bool, iClient*, sqlcfUser*);
bool shouldCJoin(sqlChannel*, bool);
bool removeFromAutoQ(Channel*);
bool removeFromManQ(Channel*);
- char getFlagChar(const sqlUser::flagType&);
- const std::string getFlagsString(const sqlUser::flagType&);
- sqlUser::flagType getFlagType(const char);
+ char getFlagChar(const sqlcfUser::flagType&);
+ const std::string getFlagsString(const sqlcfUser::flagType&);
+ sqlcfUser::flagType getFlagType(const char);
const std::string getEventName(const int);
const std::string tsToDateTime(time_t, bool);
- const std::string getHostList( sqlUser* );
+ const std::string getHostList( sqlcfUser* );
const std::string getChanNickName(const std::string&, const std::string&);
/**
* The db clients map
*/
- typedef std::map <std::string, sqlUser*, noCaseCompare> usersMapType;
+ typedef std::map <std::string, sqlcfUser*, noCaseCompare> usersMapType;
/**
* Holds the authenticated user list
helpTableType helpTable;
void loadHelpTable();
- const std::string getHelpMessage(sqlUser*, std::string);
+ const std::string getHelpMessage(sqlcfUser*, std::string);
typedef std::map < std::string, std::pair <int, std::string> > languageTableType;
languageTableType languageTable;
void loadTranslationTable();
- const std::string getResponse(sqlUser*, int, std::string = std::string());
+ const std::string getResponse(sqlcfUser*, int, std::string = std::string());
/**
* Configuration variables
std::string debugLogFile;
std::string sqlHost;
std::string sqlPort;
- std::string sqlUsername;
+ std::string sqlcfUsername;
std::string sqlPass;
std::string sqlDB;
namespace cf {
class chanfix;
-class sqlUser;
+class sqlcfUser;
class Command {
public:
virtual ~Command() { }
- virtual void Exec(iClient*, sqlUser*, const std::string&) = 0;
+ virtual void Exec(iClient*, sqlcfUser*, const std::string&) = 0;
void setServer(xServer *_server)
{ server = _server; }
unsigned short int _requiredFlags) : \
Command(_bot, _commandName, _help, _numParams, _requiredFlags) {} \
virtual ~commandName##Command() {} \
- virtual void Exec(iClient*, sqlUser*, const std::string&); \
+ virtual void Exec(iClient*, sqlcfUser*, const std::string&); \
};
/* Normal user commands */
namespace cf
{
-class sqlUser;
+class sqlcfUser;
class sqlManager;
class sqlChannel