From 123eac3f25ce4dd3142b4ac66eb321f7df1e23e4 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 21 Oct 2009 23:45:19 +0000 Subject: Change module API to use LocalUser* where correct git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11943 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_geoip.cpp | 26 +++++++++++--------------- src/modules/extra/m_ldapauth.cpp | 4 ++-- src/modules/extra/m_ssl_gnutls.cpp | 2 +- 3 files changed, 14 insertions(+), 18 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp index ff6e3c7c2..d2d8f93f8 100644 --- a/src/modules/extra/m_geoip.cpp +++ b/src/modules/extra/m_geoip.cpp @@ -62,23 +62,19 @@ class ModuleGeoIP : public Module } } - virtual ModResult OnUserRegister(User* user) + virtual ModResult OnUserRegister(LocalUser* user) { - /* only do lookups on local users */ - if (IS_LOCAL(user)) + const char* c = GeoIP_country_code_by_addr(gi, user->GetIPString()); + if (c) { - const char* c = GeoIP_country_code_by_addr(gi, user->GetIPString()); - if (c) - { - std::map::iterator x = GeoBans.find(c); - if (x != GeoBans.end()) - ServerInstance->Users->QuitUser(user, x->second); - } - else - { - if (banunknown) - ServerInstance->Users->QuitUser(user, "Could not identify your country of origin. Access denied."); - } + std::map::iterator x = GeoBans.find(c); + if (x != GeoBans.end()) + ServerInstance->Users->QuitUser(user, x->second); + } + else + { + if (banunknown) + ServerInstance->Users->QuitUser(user, "Could not identify your country of origin. Access denied."); } return MOD_RES_PASSTHRU; } diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp index 50c952704..26e968367 100644 --- a/src/modules/extra/m_ldapauth.cpp +++ b/src/modules/extra/m_ldapauth.cpp @@ -111,7 +111,7 @@ public: return true; } - ModResult OnUserRegister(User* user) + ModResult OnUserRegister(LocalUser* user) { if ((!allowpattern.empty()) && (InspIRCd::Match(user->nick,allowpattern))) { @@ -208,7 +208,7 @@ public: } } - ModResult OnCheckReady(User* user) + ModResult OnCheckReady(LocalUser* user) { return ldapAuthed.get(user) ? MOD_RES_PASSTHRU : MOD_RES_DENY; } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 0267b6595..29e439ed3 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -551,7 +551,7 @@ class ModuleSSLGnuTLS : public Module { // This occurs AFTER OnUserConnect so we can be sure the // protocol module has propagated the NICK message. - if (user->GetIOHook() == this && (IS_LOCAL(user))) + if (user->GetIOHook() == this) { if (sessions[user->GetFd()].sess) { -- cgit v1.2.3