From 548eacee47a757beb90226f3f8a36ba94619bee6 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 17 Oct 2009 02:40:16 +0000 Subject: Hold reference to the associated ConfigTag inside ConnectClass git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11880 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_ident.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/modules/m_ident.cpp') diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 0ba9e6e3a..56fa47db8 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -276,12 +276,10 @@ class IdentRequestSocket : public EventHandler class ModuleIdent : public Module { int RequestTimeout; - ConfigReader *Conf; SimpleExtItem ext; public: ModuleIdent() : ext("ident_socket", this) { - Conf = new ConfigReader; OnRehash(NULL); Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCheckReady, I_OnUserDisconnect }; ServerInstance->Modules->Attach(eventlist, this, 4); @@ -289,7 +287,6 @@ class ModuleIdent : public Module ~ModuleIdent() { - delete Conf; } virtual Version GetVersion() @@ -299,28 +296,18 @@ class ModuleIdent : public Module virtual void OnRehash(User *user) { - delete Conf; - Conf = new ConfigReader; + ConfigReader Conf; - RequestTimeout = Conf->ReadInteger("ident", "timeout", 0, true); + RequestTimeout = Conf.ReadInteger("ident", "timeout", 0, true); if (!RequestTimeout) RequestTimeout = 5; } virtual ModResult OnUserRegister(User *user) { - for (int j = 0; j < Conf->Enumerate("connect"); j++) - { - std::string hostn = Conf->ReadValue("connect","allow",j); - /* XXX: Fixme: does not respect port, limit, etc */ - if ((InspIRCd::MatchCIDR(user->GetIPString(),hostn, ascii_case_insensitive_map)) || (InspIRCd::Match(user->host,hostn, ascii_case_insensitive_map))) - { - bool useident = Conf->ReadFlag("connect", "useident", "yes", j); - - if (!useident) - return MOD_RES_PASSTHRU; - } - } + ConfigTag* tag = user->MyClass->config; + if (!tag->getBool("useident", true)) + return MOD_RES_PASSTHRU; /* User::ident is currently the username field from USER; with m_ident loaded, that * should be preceded by a ~. The field is actually IdentMax+2 characters wide. */ -- cgit v1.2.3