]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_geoip.cpp
Move configuration examples to docs, remove automatic overwrite on make install
[user/henk/code/inspircd.git] / src / modules / extra / m_geoip.cpp
index 13b35fdfbd6586bf15ce78b48494da206ffcd157..4632da22b41c53a47bb01f074df755b232f9a750 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -43,7 +43,7 @@ class ModuleGeoIP : public Module
 
        virtual Version GetVersion()
        {
-               return Version("Provides a way to restrict users by country using GeoIP lookup", VF_VENDOR, API_VERSION);
+               return Version("Provides a way to restrict users by country using GeoIP lookup", VF_VENDOR);
        }
 
        virtual void OnRehash(User* user)
@@ -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;
        }