Index: cron.php =================================================================== RCS file: /cvs/drupal/drupal/cron.php,v retrieving revision 1.36 diff -u -r1.36 cron.php --- cron.php 9 Aug 2006 07:42:55 -0000 1.36 +++ cron.php 21 Feb 2008 01:19:25 -0000 @@ -8,4 +8,6 @@ include_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); -drupal_cron_run(); +if (isset($_GET['cron_key']) && variable_get('cron_key', 'drupal') == $_GET['cron_key']) { + drupal_cron_run(); +} \ No newline at end of file Index: INSTALL.txt =================================================================== RCS file: /cvs/drupal/drupal/INSTALL.txt,v retrieving revision 1.65 diff -u -r1.65 INSTALL.txt --- INSTALL.txt 17 Feb 2008 19:29:06 -0000 1.65 +++ INSTALL.txt 21 Feb 2008 01:19:25 -0000 @@ -210,17 +210,20 @@ system module (to perform routine maintenance and pruning on system tables). To activate these tasks, call the cron page by visiting http://www.example.com/cron.php, which, in turn, executes tasks on behalf - of installed modules. + of installed modules. This page requires the addition of a cron key that + protects cron against unauthorized access. This key is available on the + /admin/reports/status page under the "Cron maintenance Tasks" section. Most systems support the crontab utility for scheduling tasks like this. The following example crontab line will activate the cron tasks automatically on the hour: - 0 * * * * wget -O - -q -t 1 http://www.example.com/cron.php + 0 * * * * wget -O - -q -t 1 http://www.example.com/cron.php?cron_key=RANDOMTEXT More information about cron maintenance tasks are available in the help pages and in Drupal's online handbook at http://drupal.org/cron. Example scripts can - be found in the scripts/ directory. + be found in the scripts/ directory. These scripts will need to be modified with + the addition of the cron key. DRUPAL ADMINISTRATION --------------------- Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.239 diff -u -r1.239 system.install --- modules/system/system.install 20 Feb 2008 13:46:41 -0000 1.239 +++ modules/system/system.install 21 Feb 2008 01:19:28 -0000 @@ -169,12 +169,15 @@ $description = $t('Cron has not run recently.') .' '. $help; } } + + $description .= ' '. $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); + $description .= '
'. $t('To run cron from outside the site, go to !cron', array('!cron' => url('cron.php', array('absolute' => true, 'query' => 'cron_key='. variable_get('cron_key', 'drupal'))))); $requirements['cron'] = array( 'title' => $t('Cron maintenance tasks'), 'severity' => $severity, 'value' => $summary, - 'description' => $description .' '. $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))), + 'description' => $description ); } @@ -404,6 +407,10 @@ db_query("INSERT INTO {variable} (name, value) VALUES ('%s','%s')", 'filter_html_1', 'i:1;'); db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'node_options_forum', 'a:1:{i:0;s:6:"status";}'); + + $cron_key = md5(time()); + + db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'cron_key', serialize($cron_key)); } /**