? cron_7.patch ? cron_9.patch ? misc/jquery.example.js ? sites/all/modules ? sites/default/files ? sites/default/settings.php Index: INSTALL.txt =================================================================== RCS file: /cvs/drupal/drupal/INSTALL.txt,v retrieving revision 1.65 diff -u -p -r1.65 INSTALL.txt --- INSTALL.txt 17 Feb 2008 19:29:06 -0000 1.65 +++ INSTALL.txt 21 Feb 2008 20:58:54 -0000 @@ -208,19 +208,30 @@ INSTALLATION used for keyword searching), aggregator module (to retrieve feeds from other sites), ping module (to notify other sites about new or updated content), and 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. - - 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 + To activate these tasks, visit the page "cron.php", which executes + maintenance tasks on behalf of installed modules. The URL of the cron.php + page requires a "cron key" to protect against unauthorized access. Each + cron key is automatically generated during installation and is specific to + your site. The full URL of the page, with cron key, is available in the "Cron + maintenance tasks" section of the "Status report page" at: + + Administer > Reports > Status report + + Most systems support using a crontab utility for automatically executing + tasks like visiting the cron.php page. The following example crontab line + uses wget to automatically visit the cron.php page each hour, on the hour: + + 0 * * * * wget -O - -q -t 1 http://www.example.com/cron.php?cron_key=RANDOMTEXT + + Replace the text "http://www.example.com/cron.php?cron_key=RANDOMTEXT" in the + example with the full URL displayed under "Cron maintenance tasks" on the + "Status report" page. 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. + and in Drupal's online handbook at http://drupal.org/cron. Example cron scripts + can be found in the scripts/ directory. (Note that these scripts must be + customized similar to the above example, to add your site-specific cron key + and domain name.) DRUPAL ADMINISTRATION --------------------- Index: cron.php =================================================================== RCS file: /cvs/drupal/drupal/cron.php,v retrieving revision 1.36 diff -u -p -r1.36 cron.php --- cron.php 9 Aug 2006 07:42:55 -0000 1.36 +++ cron.php 21 Feb 2008 20:58:54 -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: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.239 diff -u -p -r1.239 system.install --- modules/system/system.install 20 Feb 2008 13:46:41 -0000 1.239 +++ modules/system/system.install 21 Feb 2008 20:58:54 -0000 @@ -169,12 +169,15 @@ function system_requirements($phase) { $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 @@ function system_install() { 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)); } /**