? port_6.patch
Index: restrict_by_ip.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/restrict_by_ip/restrict_by_ip.info,v
retrieving revision 1.1
diff -u -p -r1.1 restrict_by_ip.info
--- restrict_by_ip.info	23 Feb 2008 03:47:41 -0000	1.1
+++ restrict_by_ip.info	20 Oct 2008 22:51:23 -0000
@@ -1,3 +1,4 @@
 ; $Id: restrict_by_ip.info,v 1.1 2008/02/23 03:47:41 peligrorice Exp $
 name = Restrict By IP
-description = "Enables limiting user login to specific IP Addresses."
\ No newline at end of file
+description = "Enables limiting user login to specific IP Addresses."
+core = 6.x
Index: restrict_by_ip.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/restrict_by_ip/restrict_by_ip.install,v
retrieving revision 1.1
diff -u -p -r1.1 restrict_by_ip.install
--- restrict_by_ip.install	23 Feb 2008 03:47:41 -0000	1.1
+++ restrict_by_ip.install	20 Oct 2008 22:51:24 -0000
@@ -6,49 +6,43 @@
  * Creates a table of the variables that will be needed to use this module
  */
 function restrict_by_ip_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {restrict_by_ip} (
-        uid int unsigned NOT NULL,
-        restrict_by_ip_address varchar(128),
-        PRIMARY KEY(uid)
-        ) /*!40100 DEFAULT CHARACTER SET utf8 */;
-      ");
-      break;
-
-    case 'pgsql':
-      db_query("CREATE TABLE {restrict_by_ip} (
-        uid int NOT NULL, 
-		    restrict_by_ip_address character(128)
-        PRIMARY KEY(uid)
-        );
-      ");
-      break;
-  }
-	watchdog ('restrict_by_ip', 'restrict_by_ip module installed');
+  drupal_install_schema('restrict_by_ip');
+ 	watchdog('restrict_by_ip', t('restrict_by_ip module installed'));
   drupal_set_message(t('The restrict_by_ip module was installed.'));
 }
 
 /**
+ * Implementation of hook_schema().
+ */
+function restrict_by_ip_schema() {
+  $schema['restrict_by_ip'] = array(
+    'description'=> t('the table for restrict by id'),
+    'fields' => array(
+      'uid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'unsigned' => TRUE
+      ),
+      'restrict_by_ip_address' => array(
+        'type' => 'varchar',
+        'length' => 128,
+      ),
+    ),
+  );
+} 
+
+/**
 * Implementation of hook_uninstall().
 */
 function restrict_by_ip_uninstall() {
 
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("DROP TABLE {restrict_by_ip}");
-      break;
-    case 'pgsql':
-      db_query("DROP TABLE {restrict_by_ip}");
-      break;
-  }
-  // clear the cache tables (see http://drupal.org/node/64279#comment-211282)
+
+  db_query("DROP TABLE {restrict_by_ip}");
+   // clear the cache tables (see http://drupal.org/node/64279#comment-211282)
   cache_clear_all('*', 'cache', TRUE);
   cache_clear_all('*', 'cache_filter', TRUE);
   cache_clear_all('*', 'cache_menu', TRUE);
   cache_clear_all('*', 'cache_page', TRUE);
 
-  watchdog ('restrict_by_ip', 'restrict_by_ip module removed');
-}
\ No newline at end of file
+  watchdog('restrict_by_ip', t('restrict_by_ip module removed'));
+}
Index: restrict_by_ip.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/restrict_by_ip/restrict_by_ip.module,v
retrieving revision 1.1
diff -u -p -r1.1 restrict_by_ip.module
--- restrict_by_ip.module	23 Feb 2008 03:47:41 -0000	1.1
+++ restrict_by_ip.module	20 Oct 2008 22:51:24 -0000
@@ -24,19 +24,17 @@ function restrict_by_ip_help($section) {
  * Implementation of hook_menu().
  *  Add a menu item to the Administer >> Site building menu for displaying the restrict_by_ip.
  */
-function restrict_by_ip_menu($may_cache) {
+function restrict_by_ip_menu() {
   $items = array();
 
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/restrict_by_ip',
-      'title' => t('Restrict by IP settings'),
-      'description' => t('Limit the IP address a user is allowed to login from.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => 'restrict_by_ip_settings',
-      'access' => user_access('administer restrict by ip'),
-    );
-  }
+  $items['admin/settings/restrict_by_ip'] = array(
+    'title'            => t('Restrict by IP settings'),
+    'description'      => t('Limit the IP address a user is allowed to login from.'),
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('restrict_by_ip_settings'),
+    'access arguments' => array('administer restrict by ip'),
+  );
+
   return $items;
 }
 
@@ -154,4 +152,4 @@ function restrict_by_ip_user($op, &$edit
 *    );
 *  return $form;
 *}
-*/
\ No newline at end of file
+*/
