--- roledelay.info	14 May 2008 00:10:01 -0000	1.2
+++ roledelay.info	9 Mar 2009 06:28:52 -0000
@@ -1,3 +1,4 @@
-; $Id: roledelay.info,v 1.2 2008/05/14 00:10:01 mcarbone Exp $
-name = Role Delay
-description = Grants users additional roles after a certain wait period from registration.
+; $Id$
+name = Role delay
+description = Grants users additional roles after a certain wait period from registration.
+core = 6.x
--- roledelay.install	21 Oct 2006 01:12:27 -0000	1.2
+++ roledelay.install	9 Mar 2009 06:28:52 -0000
@@ -1,23 +1,43 @@
 <?php
-// $Id: roledelay.install,v 1.2 2006/10/21 01:12:27 crunchywelch Exp $
+// $Id$
 
+/**
+ * Implementation of hook_install().
+ */
 function roledelay_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-    db_query("CREATE TABLE {roledelay1} (
-        uid int(11) NOT NULL default '0',
-        waitstamp int(11) NOT NULL default '0',
-        KEY waitstamp (waitstamp)) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-    db_query("CREATE TABLE {roledelay2} (
-        uid int(11) NOT NULL default '0',
-        waitstamp int(11) NOT NULL default '0',
-        KEY waitstamp (waitstamp)) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
+  drupal_install_schema('roledelay');
+}
 
-    case 'pgsql':
-      break;
-  }
+/**
+ * Implementation of hook_uninstall().
+ */
+function roledelay_uninstall() {
+  drupal_uninstall_schema('roledelay');
+  
+  variable_del('roledelay_role1');
+  variable_del('roledelay_increment1');
 }
 
+function roledelay_schema() {
+  $schema['roledelay1'] = array(
+    'fields' => array(
+      'uid' => array('type' => 'serial', 'not null' => TRUE),
+      'waitstamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+    ),
+    'indexes' => array(
+      'uid' => array('uid'),
+    ),
+  );
+
+  $schema['roledelay2'] = array(
+    'fields' => array(
+      'uid' => array('type' => 'serial', 'not null' => TRUE),
+      'waitstamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+    ),
+    'indexes' => array(
+      'uid' => array('uid'),
+    ),
+  );
 
+  return $schema;
+}
--- roledelay.module	14 May 2008 00:10:01 -0000	1.4
+++ roledelay.module	9 Mar 2009 06:28:53 -0000
@@ -1,28 +1,26 @@
 <?php
-// $Id: roledelay.module,v 1.4 2008/05/14 00:10:01 mcarbone Exp $
+// $Id$
 
 /**
- * hook_menu() implementation
+ * Implementation of hook_menu().
  */
-function roledelay_menu($may_cache) {
-  global $user;
+function roledelay_menu() {
   $items = array();
-  if ($may_cache) {
 
-    //settings page
-    $items[] = array(
-      'path' => 'admin/settings/roledelay',
-      'title' => t('Role Delay'),
-      'description' => t('Set up role delay roles and waiting periods.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('roledelay_settings'),
-    );
-  }
+  $items['admin/settings/roledelay'] = array(
+    'title' => t('Role delay'),
+    'description' => t('Set up role delay roles and waiting periods.'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('roledelay_settings'),
+    'access arguments' => array('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+
   return $items;
 }
 
 /**
- * hook_settings() implementation
+ * Menu callback; retrieves the role delay settings form.
  */
 function roledelay_settings() {
   $roles = user_roles(TRUE);
@@ -100,7 +98,7 @@ function roledelay_settings() {
 }
 
 /**
- * hook_user() implementation
+ * Implementation of hook_user().
  */
 function roledelay_user($op, &$edit, &$user, $category = NULL) {
   // Start timer on insert (default)
@@ -130,7 +128,7 @@ function roledelay_user($op, &$edit, &$u
 }
 
 /**
- * hook_cron() implementation
+ * Implementation of hook_cron().
  */
 function roledelay_cron() {
   // only proceed if the first role delay stage is setup.
@@ -173,7 +171,7 @@ function roledelay_cron() {
 }
 
 /**
- * hook_help() implementation
+ * Implementation of hook_help().
  */
 function roledelay_help($section) {
   switch ($section) {
@@ -185,4 +183,3 @@ function roledelay_help($section) {
       break;
   }
 }
-?>
