Import/Core_geoip.php
[Pman.Core] / Import / Core_geoip.php
index a884e82..238211f 100644 (file)
@@ -40,6 +40,8 @@ class Pman_Core_Import_Core_geoip extends Pman_Roo
         $this->insertLocation($location);
         
         $this->insertBlock($block);
+        
+        $this->jok("DONE");
     }
     
     function insertLocation($csv)
@@ -249,6 +251,12 @@ class Pman_Core_Import_Core_geoip extends Pman_Roo
     
     function processBlock($row)
     {
+        if(empty($this->id_mapping[$row['GEONAME_ID']])){
+            $this->log("Missing mapping for {$row['GEONAME_ID']}");
+            $this->log("IP : {$row['NETWORK_START_IP']}");
+            return;
+        }
+        
         $network_mapping = DB_DataObject::factory('core_geoip_network_mapping');
         
         $start_ip = array_pop(explode(":", $row['NETWORK_START_IP']));