X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_sqloper.cpp;h=52a73eba90963d8ea121f2ede0ea848a79a6e399;hb=219993bc9018d9f0d9568330d7a972b68b785d27;hp=ca6a2149e58a6da007c8b7906a11c903ad6145a3;hpb=739c665e2cd75584f3711d7570cebafde4878fd7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index ca6a2149e..52a73eba9 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,11 +12,6 @@ */ #include "inspircd.h" -#include "users.h" -#include "channels.h" -#include "modules.h" -#include "configreader.h" - #include "m_sqlv2.h" #include "m_sqlutils.h" #include "m_hash.h" @@ -34,7 +29,7 @@ class ModuleSQLOper : public Module irc::string hashtype; hashymodules hashers; bool diduseiface; - std::deque names; + parameterlist names; public: ModuleSQLOper(InspIRCd* Me) @@ -44,7 +39,7 @@ public: ServerInstance->Modules->UseInterface("SQL"); ServerInstance->Modules->UseInterface("HashRequest"); - OnRehash(NULL, ""); + OnRehash(NULL); diduseiface = false; @@ -78,6 +73,20 @@ public: ServerInstance->Modules->Attach(eventlist, this, 3); } + bool OneOfMatches(const char* host, const char* ip, const char* hostlist) + { + std::stringstream hl(hostlist); + std::string xhost; + while (hl >> xhost) + { + if (InspIRCd::Match(host, xhost, ascii_case_insensitive_map) || InspIRCd::MatchCIDR(ip, xhost, ascii_case_insensitive_map)) + { + return true; + } + } + return false; + } + virtual void OnLoadModule(Module* mod, const std::string& name) { if (ServerInstance->Modules->ModuleHasInterface(mod, "HashRequest")) @@ -103,7 +112,7 @@ public: } - virtual void OnRehash(User* user, const std::string ¶meter) + virtual void OnRehash(User* user) { ConfigReader Conf(ServerInstance);