Index: session_api.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/session_api/session_api.module,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 session_api.module
--- session_api.module	19 Sep 2008 17:06:14 -0000	1.1.2.3
+++ session_api.module	23 Feb 2009 00:29:46 -0000
@@ -64,57 +64,16 @@
  * Implementation of hook_cron().
  */
 function session_api_cron() {
-  // should any cleanup be run
-  if (!variable_get('session_api_run_cron_session_api', FALSE)) {
-    return;
+  // Fetch list of outdated sids.
+  $result = db_query("SELECT sap.sid FROM {session_api} sap LEFT JOIN {sessions} s ON (sap.session_id = s.sid) WHERE s.sid IS NULL");
+  $outdated_sids = array();
+  while ($session = db_fetch_object($result)) {
+    $outdated_sids[] = $session->sid;
   }
 
-  // find modules that have this hook
-  $modules = module_implements('session_api_cleanup');
-
-  // run Session API hook first
-  array_unshift($modules, 'session_api');
-  $modules = array_unique($modules);
-
-  foreach ($modules as $module) {
-    if (variable_get('session_api_run_cron_' . $module, FALSE)) {
-      module_invoke($module, 'session_api_cleanup');
-    }
-  }
-}
-
-/**
- * Implementation of hook_session_api_cleanup().
- *
- * A self implementation of the Session API cleanup hook. Generally called
- * from session_api_cron().
- *
- * @param string $op
- *   The operation the function perform.
- *    * run  - perform the cleanup
- *    * info - provide information(in the form of a keyed array) of the title
- *             and description of the cleanup.
- * @return
- *   Varies with $op.
- *   * run - NULL
- *   * info - a keyed array containing title and description
- */
-function session_api_session_api_cleanup($op = 'run') {
-  switch ($op) {
-    case 'info':
-      return array(
-        'title' => t('Clear expired <strong>Session API</strong> sessions'),
-        'description' => t('Clear out old <strong>Session API</strong> IDs for which the corresponding <a href="!php">PHP session</a> no longer exists. <br /><strong>Important</strong>: This option must be checked for any of the subsequent cleanup processes to work. Unchecking this will disable any removal of expired session data.', array('!php' => url('http://php.net/manual/en/book.session.php'))),
-      );
-
-    case 'run':
-    default:
-      // fetch list of outdated sids
-      $result = db_query("SELECT sap.sid FROM {session_api} sap LEFT JOIN {sessions} s ON (sap.session_id = s.sid) WHERE s.sid IS NULL");
-      while ($session = db_fetch_object($result)) {
-       // remove the session api id
-        db_query("DELETE FROM {session_api} WHERE sid = %d", $session->sid);
-      }
+  if (!empty($outdated_sids)) {
+    module_invoke_all('session_api_cleanup', $outdated_sids);
+    db_query('DELETE FROM {session_api} WHERE sid IN (' . implode(',', $outdated_sids) . ')');
   }
 }
 
Index: session_api.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/session_api/session_api.install,v
retrieving revision 1.1
diff -u -r1.1 session_api.install
--- session_api.install	1 Jul 2008 18:21:30 -0000	1.1
+++ session_api.install	23 Feb 2009 00:29:46 -0000
@@ -41,4 +41,14 @@
 
   return $schema;
 }
-      
\ No newline at end of file
+
+/**
+ * Remove cleanup variables.
+ */
+function session_api_update_6100() {
+  $ret = array();
+
+  $ret[] = update_sql("DELETE FROM {variable} WHERE name LIKE 'session_api_run_cron_%'");
+
+  return $ret;
+}
Index: session_api.admin.inc
===================================================================
RCS file: session_api.admin.inc
diff -N session_api.admin.inc
--- session_api.admin.inc	9 Jul 2008 15:32:31 -0000	1.1.2.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-<?php
-
-// $Id: session_api.admin.inc,v 1.1.2.3 2008/07/09 15:32:31 jhedstrom Exp $
-
-/**
- * @file
- * Session API admin functions.
- */
-
-/**
- * Session API admin settings form.
- */
-function session_api_settings_form() {
-  // find modules that implement hook_session_api_cleanup()
-  $modules = module_implements('session_api_cleanup');
-
-  $form['maintenance'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Maintenance Tasks'),
-    '#description' => t('The following modules have jobs that are run on cron to cleanup expired session information.'),
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-  );
-
-  // throw Session API to the top
-  array_unshift($modules, 'session_api');
-  $modules = array_unique($modules);
-
-  foreach ($modules as $module) {
-    // gather module-specific information about the cleanup process each on
-    // implements.
-    $info = module_invoke($module, 'session_api_cleanup', 'info');
-    $form['maintenance']['session_api_run_cron_' . $module] = array(
-      '#title' => $info['title'],
-      '#description' => $info['description'],
-      '#type' => 'checkbox',
-      '#default_value' => variable_get('session_api_run_cron_' . $module, FALSE),
-    );
-  }
-
-  return system_settings_form($form);
-}
