From: <ps...@us...> - 2010-02-25 12:31:52
|
Revision: 1794 http://znc.svn.sourceforge.net/znc/?rev=1794&view=rev Author: psychon Date: 2010-02-25 12:29:40 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Remove --disable-modules ZNC without modules is like rain without being inside, you really don't want that! Modified Paths: -------------- trunk/Chan.cpp trunk/Client.cpp trunk/ClientCommand.cpp trunk/HTTPSock.cpp trunk/HTTPSock.h trunk/Makefile.in trunk/Modules.cpp trunk/Modules.h trunk/Socket.cpp trunk/Template.cpp trunk/Template.h trunk/User.cpp trunk/User.h trunk/configure.in trunk/main.h trunk/znc.cpp trunk/znc.h Modified: trunk/Chan.cpp =================================================================== --- trunk/Chan.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Chan.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -215,13 +215,11 @@ CString sArgs = sModes.Token(1, true); bool bAdd = true; -#ifdef _MODULES CNick* pOpNick = FindNick(sOpNick); if (pOpNick) { MODULECALL(OnRawMode(*pOpNick, *this, sModeArg, sArgs), m_pUser, NULL, ); } -#endif for (unsigned int a = 0; a < sModeArg.size(); a++) { const unsigned char& uMode = sModeArg[a]; @@ -250,7 +248,6 @@ RemPerm(uPerm); } } -#ifdef _MODULES bool bNoChange = (pNick->HasPerm(uPerm) == bAdd); if (uMode && pOpNick) { @@ -270,7 +267,6 @@ } } } -#endif } } } else { @@ -295,7 +291,6 @@ break; } -#ifdef _MODULES bool bNoChange; if (bList) { bNoChange = false; @@ -305,7 +300,6 @@ bNoChange = !HasMode(uMode); } MODULECALL(OnMode(*pOpNick, *this, uMode, sArg, bAdd, bNoChange), m_pUser, NULL, ); -#endif if (!bList) { (bAdd) ? AddMode(uMode, sArg) : RemMode(uMode); Modified: trunk/Client.cpp =================================================================== --- trunk/Client.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Client.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -64,7 +64,6 @@ DEBUG("(" << ((m_pUser) ? m_pUser->GetUserName() : GetRemoteIP()) << ") CLI -> ZNC [" << sLine << "]"); -#ifdef _MODULES if (IsAttached()) { MODULECALL(OnUserRaw(sLine), m_pUser, this, return); } else { @@ -91,7 +90,6 @@ return; } } -#endif CString sCommand = sLine.Token(0); if (sCommand.Left(1) == ":") { @@ -176,12 +174,10 @@ else UserCommand(sModCommand); } else { -#ifdef _MODULES if (sModCommand.empty()) CALLMOD(sTarget, this, m_pUser, PutModule("Hello. How may I help you?")) else CALLMOD(sTarget, this, m_pUser, OnModCommand(sModCommand)) -#endif } return; } else if (sCommand.Equals("DETACH")) { @@ -332,11 +328,9 @@ } if (sTarget.TrimPrefix(m_pUser->GetStatusPrefix())) { -#ifdef _MODULES if (!sTarget.Equals("status")) { CALLMOD(sTarget, this, m_pUser, OnModNotice(sMsg)); } -#endif return; } @@ -348,7 +342,6 @@ } #endif -#ifdef _MODULES if (sMsg.WildCmp("\001*\001")) { CString sCTCP = sMsg; sCTCP.LeftChomp(); @@ -360,7 +353,6 @@ } else { MODULECALL(OnUserNotice(sTarget, sMsg), m_pUser, this, return); } -#endif if (!GetIRCSock()) { // Some lagmeters do a NOTICE to their own nick, ignore those. @@ -498,9 +490,7 @@ if (sTarget.Equals("status")) { StatusCTCP(sCTCP); } else { -#ifdef _MODULES CALLMOD(sTarget, this, m_pUser, OnModCTCP(sCTCP)); -#endif } return; } @@ -540,9 +530,7 @@ if (sTarget.Equals("status")) { UserCommand(sMsg); } else { -#ifdef _MODULES CALLMOD(sTarget, this, m_pUser, OnModCommand(sMsg)); -#endif } return; } @@ -622,26 +610,6 @@ } void CClient::AuthUser() { - /* -#ifdef _MODULES - if (CZNC::Get().GetModules().OnLoginAttempt(m_sUser, m_sPass, *this)) { - return; - } -#endif - - CUser* pUser = CZNC::Get().GetUser(m_sUser); - - if (pUser && pUser->CheckPass(m_sPass)) { - AcceptLogin(*pUser); - } else { - if (pUser) { - pUser->PutStatus("Another client attempted to login as you, with a bad password."); - } - - RefuseLogin(); - } - */ - m_spAuth = new CClientAuth(this, m_sUser, m_sPass); CZNC::Get().AuthUser(m_spAuth); @@ -689,9 +657,7 @@ "to login as you, but was rejected [" + sReason + "]."); } -#ifdef _MODULES CZNC::Get().GetModules().OnFailedLogin(GetUsername(), GetRemoteIP()); -#endif RefusedLogin(sReason); Invalidate(); } Modified: trunk/ClientCommand.cpp =================================================================== --- trunk/ClientCommand.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/ClientCommand.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -547,7 +547,6 @@ PutStatus("You have no active DCCs."); } } else if (sCommand.Equals("LISTMODS") || sCommand.Equals("LISTMODULES")) { -#ifdef _MODULES if (m_pUser->IsAdmin()) { CModules& GModules = CZNC::Get().GetModules(); @@ -587,12 +586,8 @@ PutStatus(Table); } -#else - PutStatus("Modules are not enabled."); -#endif return; } else if (sCommand.Equals("LISTAVAILMODS") || sCommand.Equals("LISTAVAILABLEMODULES")) { -#ifdef _MODULES if (m_pUser->DenyLoadMod()) { PutStatus("Access Denied."); return; @@ -643,9 +638,6 @@ PutStatus(Table); } -#else - PutStatus("Modules are not enabled."); -#endif return; } else if (sCommand.Equals("LOADMOD") || sCommand.Equals("LOADMODULE")) { CString sMod; @@ -664,7 +656,6 @@ return; } -#ifdef _MODULES CModInfo ModInfo; CString sRetMsg; if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod, sRetMsg)) { @@ -694,9 +685,6 @@ } PutStatus(sModRet); -#else - PutStatus("Unable to load [" + sMod + "] Modules are not enabled."); -#endif return; } else if (sCommand.Equals("UNLOADMOD") || sCommand.Equals("UNLOADMODULE")) { CString sMod; @@ -706,7 +694,6 @@ PutStatus("Unable to unload [" + sMod + "] Access Denied."); return; } -#ifdef _MODULES if (sMod.empty()) { PutStatus("Usage: UnloadMod <module>"); return; @@ -723,9 +710,6 @@ } PutStatus(sModRet); -#else - PutStatus("Unable to unload [" + sMod + "] Modules are not enabled."); -#endif return; } else if (sCommand.Equals("RELOADMOD") || sCommand.Equals("RELOADMODULE")) { CString sMod; @@ -744,7 +728,6 @@ return; } -#ifdef _MODULES CModInfo ModInfo; CString sRetMsg; if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod, sRetMsg)) { @@ -768,14 +751,8 @@ } PutStatus(sModRet); -#else - PutStatus("Unable to unload [" + sMod + "] Modules are not enabled."); -#endif return; } else if ((sCommand.Equals("UPDATEMOD") || sCommand.Equals("UPDATEMODULE")) && m_pUser->IsAdmin() ) { -#ifndef _MODULES - PutStatus("Modules are not enabled."); -#else CString sMod = sLine.Token(1); if (sMod.empty()) { @@ -795,7 +772,6 @@ PutStatus("Done, but there were errors, some users no longer have [" + sMod + "] loaded"); } -#endif } else if (sCommand.Equals("ADDVHOST") && m_pUser->IsAdmin()) { CString sVHost = sLine.Token(1); Modified: trunk/HTTPSock.cpp =================================================================== --- trunk/HTTPSock.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/HTTPSock.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -6,8 +6,6 @@ * by the Free Software Foundation. */ -#ifdef _MODULES - #include "Modules.h" #include "HTTPSock.h" #include "znc.h" @@ -459,5 +457,3 @@ DEBUG(GetSockName() << " == ReachedMaxBuffer()"); Close(); } - -#endif // _MODULES Modified: trunk/HTTPSock.h =================================================================== --- trunk/HTTPSock.h 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/HTTPSock.h 2010-02-25 12:29:40 UTC (rev 1794) @@ -6,8 +6,6 @@ * by the Free Software Foundation. */ -#ifdef _MODULES - #ifndef _HTTPSOCK_H #define _HTTPSOCK_H @@ -94,5 +92,3 @@ }; #endif // !_HTTPSOCK_H - -#endif // _MODULES Modified: trunk/Makefile.in =================================================================== --- trunk/Makefile.in 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Makefile.in 2010-02-25 12:29:40 UTC (rev 1794) @@ -32,7 +32,7 @@ .PHONY: all man modules clean distclean install -all: znc man @MODTARGET@ $(LIBZNC) +all: znc man modules $(LIBZNC) ifeq "$(LIBZNC)" "" OBJS := $(BIN_OBJS) $(LIB_OBJS) @@ -51,17 +51,11 @@ @$(MAKE) -C man modules: $(LIBZNC) - @if test -n "@MODTARGET@"; then \ - $(MAKE) -C modules; \ - else \ - echo "Modules are not enabled"; \ - fi + $(MAKE) -C modules; clean: rm -rf $(CLEAN) - @if test -n "@MODTARGET@"; then \ - $(MAKE) -C modules clean; \ - fi + @$(MAKE) -C modules clean; @$(MAKE) -C man clean distclean: clean @@ -82,9 +76,7 @@ install -m 0755 znc-buildmod $(DESTDIR)$(bindir) install -m 0644 $(srcdir)/*.h $(DESTDIR)$(includedir)/znc install -m 0644 znc.pc $(DESTDIR)$(PKGCONFIGDIR) - @if test -n "@MODTARGET@"; then \ - $(MAKE) -C modules install DESTDIR=$(DESTDIR); \ - fi + @$(MAKE) -C modules install DESTDIR=$(DESTDIR); if test -n "$(LIBZNC)"; then \ mkdir -p $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \ install -m 0755 $(LIBZNC) $(DESTDIR)$(LIBZNCDIR) || exit 1 ; \ Modified: trunk/Modules.cpp =================================================================== --- trunk/Modules.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Modules.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -6,8 +6,6 @@ * by the Free Software Foundation. */ -#ifdef _MODULES - #include "Modules.h" #include "User.h" #include "znc.h" @@ -990,5 +988,3 @@ return p; } - -#endif // _MODULES Modified: trunk/Modules.h =================================================================== --- trunk/Modules.h 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Modules.h 2010-02-25 12:29:40 UTC (rev 1794) @@ -6,8 +6,6 @@ * by the Free Software Foundation. */ -#ifdef _MODULES - #ifndef _MODULES_H #define _MODULES_H @@ -918,5 +916,3 @@ }; #endif // !_MODULES_H - -#endif // _MODULES Modified: trunk/Socket.cpp =================================================================== --- trunk/Socket.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Socket.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -28,8 +28,6 @@ return ret; } -#ifdef _MODULES - /////////////////// CSocket /////////////////// CSocket::CSocket(CModule* pModule) : CZNCSock() { m_pModule = pModule; @@ -132,5 +130,3 @@ void CSocket::SetModule(CModule* p) { m_pModule = p; } CModule* CSocket::GetModule() const { return m_pModule; } /////////////////// !CSocket /////////////////// - -#endif // _MODULES Modified: trunk/Template.cpp =================================================================== --- trunk/Template.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Template.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -6,8 +6,6 @@ * by the Free Software Foundation. */ -#ifdef _MODULES - #include "Template.h" #include "FileUtils.h" #include <sstream> @@ -852,5 +850,3 @@ return sRet; } - -#endif // _MODULES Modified: trunk/Template.h =================================================================== --- trunk/Template.h 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/Template.h 2010-02-25 12:29:40 UTC (rev 1794) @@ -6,8 +6,6 @@ * by the Free Software Foundation. */ -#ifdef _MODULES - #ifndef _TEMPLATE_H #define _TEMPLATE_H @@ -184,5 +182,3 @@ }; #endif // !_TEMPLATE_H - -#endif // _MODULES Modified: trunk/User.cpp =================================================================== --- trunk/User.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/User.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -59,9 +59,7 @@ m_uServerIdx = 0; m_uBytesRead = 0; m_uBytesWritten = 0; -#ifdef _MODULES m_pModules = new CModules; -#endif m_RawBuffer.SetLineCount(100); // This should be more than enough raws, especially since we are buffering the MOTD separately m_MotdBuffer.SetLineCount(200); // This should be more than enough motd lines m_bMultiClients = true; @@ -90,9 +88,7 @@ CUser::~CUser() { DelClients(); -#ifdef _MODULES DelModules(); -#endif DelServers(); @@ -110,7 +106,6 @@ CZNC::Get().GetManager().DelCronByAddr(m_pUserTimer); } -#ifdef _MODULES void CUser::DelModules() { if (m_pModules) { delete m_pModules; @@ -144,7 +139,6 @@ return !error; } -#endif void CUser::DelClients() { for (unsigned int c = 0; c < m_vClients.size(); c++) { @@ -464,7 +458,6 @@ SetTimezoneOffset(User.GetTimezoneOffset()); // !Flags -#ifdef _MODULES // Modules set<CString> ssUnloadMods; CModules& vCurMods = GetModules(); @@ -495,7 +488,6 @@ vCurMods.UnloadModule(*it); } // !Modules -#endif // !_MODULES return true; } @@ -682,7 +674,6 @@ File.Write("\n"); } -#ifdef _MODULES // Modules CModules& Mods = GetModules(); @@ -699,7 +690,6 @@ File.Write("\n"); } -#endif // Servers for (unsigned int b = 0; b < m_vServers.size(); b++) { Modified: trunk/User.h =================================================================== --- trunk/User.h 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/User.h 2010-02-25 12:29:40 UTC (rev 1794) @@ -11,9 +11,7 @@ #include "Buffer.h" #include "FileUtils.h" -#ifdef _MODULES #include "Modules.h" -#endif #include "Nick.h" #include <set> #include <vector> @@ -73,7 +71,6 @@ void DelClients(); void DelServers(); -#ifdef _MODULES void DelModules(); // Unloads a module on all users who have it loaded and loads it again. @@ -83,7 +80,6 @@ CModules& GetModules() { return *m_pModules; } const CModules& GetModules() const { return *m_pModules; } // !Modules -#endif // Buffers void AddRawBuffer(const CString& sPre, const CString& sPost, bool bIncNick = true) { m_RawBuffer.AddLine(sPre, sPost, bIncNick); } @@ -313,9 +309,7 @@ map<CString, unsigned int> m_suWebLogoutCounters; -#ifdef _MODULES CModules* m_pModules; -#endif }; #endif // !_USER_H Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/configure.in 2010-02-25 12:29:40 UTC (rev 1794) @@ -77,10 +77,6 @@ AS_HELP_STRING([--disable-ipv6], [disable ipv6 support]), [IPV6="$enableval"], [IPV6="yes"]) -AC_ARG_ENABLE( [modules], - AS_HELP_STRING([--disable-modules], [disable modules]), - [MODULES="$enableval"], - [MODULES="yes"]) AC_ARG_ENABLE( [openssl], AS_HELP_STRING([--disable-openssl], [disable openssl]), [if test "$enableval" = "no" ; then NOSSL=1; fi],) @@ -177,7 +173,10 @@ [DATADIR="${datadir}/znc"] ) -if test "$MODULES" = "yes"; then +# This used to be +# if test "$MODULES" = "yes"; then +# but I'm too lazy to reindent all of this +if test "yes" = "yes"; then FOUND_DL=no # Don't use any libs like -lssl -lcrypto when checking for dlopen(), @@ -194,14 +193,12 @@ AC_MSG_ERROR([could not find dlopen. Try --disable-modules]) fi - appendCXX -D_MODULES appendMod "$CXXFLAGS" if test -z "$ISSUN" -a -z "$ISDARWIN"; then # This is an unknown compiler flag on some OS appendLD -Wl,--export-dynamic fi - MODTARGET="modules" if test -z "$ISCYGWIN" ; then # cygwin doesn't need -fPIC, everything else does (for modules) @@ -297,7 +294,6 @@ AC_SUBST([LIBZNC]) AC_SUBST([LIBZNCDIR]) AC_SUBST([MODLINK]) -AC_SUBST([MODTARGET]) AC_SUBST([NOSSL]) AC_SUBST([EXTRA]) AC_SUBST([PERL]) @@ -311,9 +307,7 @@ AC_CONFIG_FILES([man/Makefile]) AC_CONFIG_FILES([znc.pc]) AC_CONFIG_FILES([znc-uninstalled.pc]) -if test "$MODULES" = "yes"; then - AC_CONFIG_FILES([modules/Makefile]) -fi +AC_CONFIG_FILES([modules/Makefile]) AC_OUTPUT echo @@ -327,7 +321,6 @@ echo "openssl: yes" fi echo "c-ares: $ARES" -echo "modules: $MODULES" if test x"$PERL" = "x" ; then echo "perl: no" else Modified: trunk/main.h =================================================================== --- trunk/main.h 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/main.h 2010-02-25 12:29:40 UTC (rev 1794) @@ -32,7 +32,6 @@ #define _DATADIR_ "/usr/share/znc" #endif -#ifdef _MODULES #define MODULECALL(macFUNC, macUSER, macCLIENT, macEXITER) \ if (macUSER) { \ CGlobalModules& GMods = CZNC::Get().GetModules(); \ @@ -53,9 +52,6 @@ GMods.SetClient(pOldGClient); \ UMods.SetClient(pOldUClient); \ } -#else -#define MODULECALL(macFUNC, macUSER, macCLIENT, macEXITER) -#endif /** @mainpage * Welcome to the API documentation for ZNC. Modified: trunk/znc.cpp =================================================================== --- trunk/znc.cpp 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/znc.cpp 2010-02-25 12:29:40 UTC (rev 1794) @@ -31,9 +31,7 @@ exit(-1); } -#ifdef _MODULES m_pModules = new CGlobalModules(); -#endif m_pISpoofLockFile = NULL; m_uiConnectDelay = 30; m_uiAnonIPLimit = 10; @@ -50,13 +48,11 @@ if (m_pISpoofLockFile) ReleaseISpoof(); -#ifdef _MODULES m_pModules->UnloadAll(); for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); ++a) { a->second->GetModules().UnloadAll(); } -#endif for (size_t b = 0; b < m_vpListeners.size(); b++) { delete m_vpListeners[b]; @@ -71,9 +67,7 @@ m_Manager.Cleanup(); DeleteUsers(); -#ifdef _MODULES delete m_pModules; -#endif ShutdownCsocket(); DeletePidFile(); @@ -108,7 +102,6 @@ } bool CZNC::OnBoot() { -#ifdef _MODULES if (!GetModules().OnBoot()) { return false; } @@ -118,7 +111,6 @@ return false; } } -#endif return true; } @@ -200,12 +192,10 @@ CUser* pUser = it->second; pUser->SetBeingDeleted(true); -#ifdef _MODULES if (GetModules().OnDeleteUser(*pUser)) { pUser->SetBeingDeleted(false); continue; } -#endif m_msUsers.erase(pUser->GetUserName()); // Don't use pUser->GetIRCSock(), as that only returns something if the @@ -217,9 +207,7 @@ } pUser->DelClients(); -#ifdef _MODULES pUser->DelModules(); -#endif AddBytesRead(pUser->BytesRead()); AddBytesWritten(pUser->BytesWritten()); delete pUser; @@ -592,7 +580,6 @@ m_LockFile.Write("VHost = " + m_vsVHosts[v].FirstLine() + "\n"); } -#ifdef _MODULES CGlobalModules& Mods = GetModules(); for (unsigned int a = 0; a < Mods.size(); a++) { @@ -605,7 +592,6 @@ m_LockFile.Write("LoadModule = " + sName.FirstLine() + sArgs + "\n"); } -#endif for (map<CString,CUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { CString sErr; @@ -683,7 +669,6 @@ vsLines.push_back("Listen" + s6 + " = " + sListenHost + sSSL + CString(uListenPort)); // !Listen -#ifdef _MODULES set<CModInfo> ssGlobalMods; GetModules().GetAvailableMods(ssGlobalMods, true); size_t uNrOtherGlobalMods = FilterUncommonModules(ssGlobalMods); @@ -731,7 +716,6 @@ } } } -#endif // User CUtils::PrintMessage(""); @@ -791,7 +775,6 @@ vsLines.push_back("\tChanModes = " + sAnswer); } -#ifdef _MODULES set<CModInfo> ssUserMods; GetModules().GetAvailableMods(ssUserMods); size_t uNrOtherUserMods = FilterUncommonModules(ssUserMods); @@ -840,7 +823,6 @@ } } } -#endif vsLines.push_back(""); CUtils::PrintMessage(""); @@ -963,7 +945,6 @@ return bFileOpen && CUtils::GetBoolInput("Launch znc now?", true); } -#ifdef _MODULES size_t CZNC::FilterUncommonModules(set<CModInfo>& ssModules) { const char* ns[] = { "webadmin", "admin", "chansaver", "keepnick", "simple_away", "partyline", @@ -983,7 +964,6 @@ return uNrRemoved; } -#endif bool CZNC::ParseConfig(const CString& sConfig) { @@ -996,13 +976,11 @@ bool CZNC::RehashConfig(CString& sError) { -#ifdef _MODULES GetModules().OnPreRehash(); for (map<CString, CUser*>::iterator itb = m_msUsers.begin(); itb != m_msUsers.end(); ++itb) { itb->second->GetModules().OnPreRehash(); } -#endif // This clears m_msDelUsers HandleUserDeletion(); @@ -1012,13 +990,11 @@ m_msUsers.clear(); if (DoRehash(sError)) { -#ifdef _MODULES GetModules().OnPostRehash(); for (map<CString, CUser*>::iterator it = m_msUsers.begin(); it != m_msUsers.end(); ++it) { it->second->GetModules().OnPostRehash(); } -#endif return true; } @@ -1094,9 +1070,7 @@ CUser* pRealUser = NULL; // If we rehash a user, this is the real one CChan* pChan = NULL; // Used to keep track of which chan block we are in unsigned int uLineNum = 0; -#ifdef _MODULES MCString msModules; // Modules are queued for later loading -#endif std::list<CGlobalModuleConfigLine> lGlobalModuleConfigLine; @@ -1429,7 +1403,6 @@ } else if (sName.Equals("LoadModule")) { CString sModName = sValue.Token(0); CUtils::PrintAction("Loading Module [" + sModName + "]"); -#ifdef _MODULES CString sModRet; CString sArgs = sValue.Token(1, true); @@ -1445,10 +1418,6 @@ sError = sModRet; return false; } -#else - sError = "Modules are not enabled."; - CUtils::PrintStatus(false, sError); -#endif continue; } } @@ -1544,7 +1513,6 @@ continue; } else if (sName.Equals("LoadModule")) { -#ifdef _MODULES CString sModName = sValue.Token(0); CString sArgs = sValue.Token(1, true); @@ -1555,9 +1523,6 @@ return false; } msModules[sModName] = sArgs; -#else - CUtils::PrintError("Modules are not enabled."); -#endif continue; } else if (sName.Equals("ISpoofFormat")) { m_sISpoofFormat = sValue; @@ -1615,7 +1580,6 @@ } } -#ifdef _MODULES // First step: Load and reload new modules or modules with new arguments for (MCString::iterator it = msModules.begin(); it != msModules.end(); ++it) { CString sModName = it->first; @@ -1684,7 +1648,6 @@ CUtils::PrintMessage("unhandled global module config line [GM:" + it->m_sName + "] = [" + it->m_sValue + "]"); } } -#endif if (pChan) { // TODO last <Chan> not closed @@ -1864,12 +1827,10 @@ } void CZNC::AuthUser(CSmartPtr<CAuthBase> AuthClass) { -#ifdef _MODULES // TODO unless the auth module calls it, CUser::IsHostAllowed() is not honoured if (GetModules().OnLoginAttempt(AuthClass)) { return; } -#endif CUser* pUser = GetUser(AuthClass->GetUsername()); Modified: trunk/znc.h =================================================================== --- trunk/znc.h 2010-02-24 06:31:58 UTC (rev 1793) +++ trunk/znc.h 2010-02-25 12:29:40 UTC (rev 1794) @@ -11,9 +11,7 @@ #include "Client.h" #include "FileUtils.h" -#ifdef _MODULES #include "Modules.h" -#endif #include "Socket.h" #include <map> @@ -92,10 +90,8 @@ enum ConfigState GetConfigState() const { return m_eConfigState; } CSockManager& GetManager() { return m_Manager; } const CSockManager& GetManager() const { return m_Manager; } -#ifdef _MODULES CGlobalModules& GetModules() { return *m_pModules; } size_t FilterUncommonModules(set<CModInfo>& ssModules); -#endif CString GetSkinName() const { return m_sSkinName; } const CString& GetStatusPrefix() const { return m_sStatusPrefix; } const CString& GetCurPath() const { if (!CFile::Exists(m_sCurPath)) { CDir::MakeDir(m_sCurPath); } return m_sCurPath; } @@ -170,9 +166,7 @@ CFile* m_pISpoofLockFile; unsigned int m_uiConnectDelay; unsigned int m_uiAnonIPLimit; -#ifdef _MODULES CGlobalModules* m_pModules; -#endif unsigned long long m_uBytesRead; unsigned long long m_uBytesWritten; CConnectUserTimer *m_pConnectUserTimer; @@ -192,14 +186,10 @@ virtual Csock* GetSockObj(const CString& sHost, unsigned short uPort) { CClient *pClient = new CClient(sHost, uPort); if (CZNC::Get().AllowConnectionFrom(sHost)) { -#ifdef _MODULES CZNC::Get().GetModules().OnClientConnect(pClient, sHost, uPort); -#endif } else { pClient->RefuseLogin("Too many anonymous connections from your IP"); -#ifdef _MODULES CZNC::Get().GetModules().OnFailedLogin("", sHost); -#endif } return pClient; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |