? geoipd5.patch
Index: geoip.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geoip/geoip.info,v
retrieving revision 1.1
diff -u -r1.1 geoip.info
--- geoip.info	20 Feb 2009 17:47:21 -0000	1.1
+++ geoip.info	20 Feb 2009 18:30:24 -0000
@@ -1,4 +1,4 @@
 ; $Id: geoip.info,v 1.1 2009/02/20 17:47:21 rz Exp $
 name = GeoIP
 description = API for using the MaxMind GeoLite Country database
-core = 6.x
+
Index: geoip.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/geoip/geoip.module,v
retrieving revision 1.1
diff -u -r1.1 geoip.module
--- geoip.module	20 Feb 2009 17:47:21 -0000	1.1
+++ geoip.module	20 Feb 2009 18:30:24 -0000
@@ -7,16 +7,19 @@
  */
 
 /**
- * Implementation of hook_user().
+ * Implementation of hook_menu().
  */
-function geoip_menu() {
-  $items['admin/settings/geoip'] = array(
-    'title' => 'GeoIP',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('geoip_admin_settings'),
-    'access arguments' => array('administer site configuration'),
-  );
-
+function geoip_menu($may_cache) {
+  $items = array();
+  if ($may_cache) {
+    $items[] = array(
+      'path' => 'admin/settings/geoip',
+      'title' => t('GeoIP'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('geoip_admin_settings'),
+      'access' => user_access('administer site configuration')
+    );
+  }
   return $items;
 }
 
@@ -120,7 +123,7 @@
     drupal_set_message('Using IP: '. $ip .'.');
   }
   else {
-    $ip = ip_address();
+    $ip = $_SERVER['REMOTE_ADDR'];
   }
   return $ip;
 }
@@ -152,7 +155,7 @@
     drupal_set_message(t('Please <a href="!url">configure</a> the GeoIP data file location.', array('!url' => url('admin/settings/geoip'))));
     return FALSE;
   }
-  module_load_include('inc', 'geoip', 'lib/geoip');
+  include_once(drupal_get_path('module', 'geoip') .'/lib/geoip.inc');
   $instance = geoip_open($data_file, GEOIP_STANDARD);
 
   return $instance;
