? cron_uid.patch
? cron_uid2.patch
? cron_uid3.patch
? includes/request_0.patch
Index: cron.php
===================================================================
RCS file: /cvs/drupal/drupal/cron.php,v
retrieving revision 1.28
diff -u -Ftion -r1.28 cron.php
--- cron.php	9 Jan 2005 09:22:38 -0000	1.28
+++ cron.php	14 Mar 2005 05:53:14 -0000
@@ -6,6 +6,7 @@
  * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
  */
 
+$cron_is_running = true;
 include_once 'includes/bootstrap.inc';
 include_once 'includes/common.inc' ;
 
@@ -22,6 +23,10 @@ // If not in 'safe mode', increase the m
   variable_set('cron_busy', true);
 }
 
+// set cron user
+$cron_uid = variable_get('cron_uid', '0');      // anonymous has uid == 0
+$user = user_load(array('uid' => $cron_uid));
+
 // Iterate through the modules calling their cron handlers (if any):
 module_invoke_all('cron');
 
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.14
diff -u -Ftion -r1.14 session.inc
--- includes/session.inc	1 Mar 2005 20:15:10 -0000	1.14
+++ includes/session.inc	14 Mar 2005 05:53:14 -0000
@@ -7,8 +7,9 @@  * User session handling functions.
  */
 
 session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");
-session_start();
-
+if (!$cron_is_running) {
+  session_start();
+}
 /*** Session functions *****************************************************/
 
 function sess_open($save_path, $session_name) {
Index: modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.197
diff -u -Ftion -r1.197 system.module
--- modules/system.module	8 Mar 2005 22:06:10 -0000	1.197
+++ modules/system.module	14 Mar 2005 05:53:16 -0000
@@ -202,6 +202,15 @@   $group .= form_textfield(t('E-mail add
   $group .= form_textarea(t('Mission'), 'site_mission', variable_get('site_mission', ''), 70, 5, t('Your site\'s mission statement or focus.'));
   $group .= form_textarea(t('Footer message'), 'site_footer', variable_get('site_footer', ''), 70, 5, t('This text will be displayed at the bottom of each page.  Useful for adding a copyright notice to your pages.'));
   $group .= form_textfield(t('Anonymous user'), 'anonymous', variable_get('anonymous', 'Anonymous'), 70, 70, t('The name used to indicate anonymous users.'));
+  $cron_uid = variable_get('cron_uid', '0');
+  $cron_user = user_load(array('uid' => $cron_uid));
+  if (!isset$cron_user->uid) {
+    $group .=form_set_error('invalid user', t('User ID %uid does not exist', array('%uid' => $cron_uid)));
+  }
+  else {
+    variable_set('cron_uid', $cron_user->uid);
+  }
+  $group .= form_textfield(t('Cron user identifier (uid)'), 'cron_uid', variable_get('cron_uid', '0'), 7, 7, t('The user identifier (UID) used for cron jobs. Look up UIDs in %url.', array('%url' => l('the user admin page','admin/user'))));
   $group .= form_textfield(t('Default front page'), 'site_frontpage', variable_get('site_frontpage', 'node'), 70, 70, t('The home page displays content from this relative URL.  If you are not using clean URLs, specify the part after "?q=".  If unsure, specify "node".'));
 
   // check if clean URLs are supported (HTTP 200 = Ok)
