diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:45:19 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-21 23:45:19 +0000 |
commit | 123eac3f25ce4dd3142b4ac66eb321f7df1e23e4 (patch) | |
tree | 7503b5ce313dc18edc4b39dd0e580ba6ea7fc930 /src/modules/extra | |
parent | 5d03657b63b0b77edc25cd566d9aab134d930bf7 (diff) |
Change module API to use LocalUser* where correct
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11943 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_geoip.cpp | 26 | ||||
-rw-r--r-- | src/modules/extra/m_ldapauth.cpp | 4 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 2 |
3 files changed, 14 insertions, 18 deletions
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<std::string, std::string>::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<std::string, std::string>::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) { |