diff --git a/admin/renderer.php b/admin/renderer.php index 1588436f1c9..944b5016047 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -562,11 +562,23 @@ class core_admin_renderer extends plugin_renderer_base { * @return string HTML to output. */ public function cron_overdue_warning($cronoverdue) { + global $CFG; if (!$cronoverdue) { return ''; } - return $this->warning(get_string('cronwarning', 'admin') . ' ' . + if (empty($CFG->cronclionly)) { + $url = new moodle_url('/admin/cron.php'); + if (!empty($CFG->cronremotepassword)) { + $url = new moodle_url('/admin/cron.php', array('password' => $CFG->cronremotepassword)); + } + + return $this->warning(get_string('cronwarning', 'admin', $url->out()) . ' ' . + $this->help_icon('cron', 'admin')); + } + + // $CFG->cronclionly is not empty: cron can run only from CLI. + return $this->warning(get_string('cronwarningcli', 'admin') . ' ' . $this->help_icon('cron', 'admin')); } diff --git a/lang/en/admin.php b/lang/en/admin.php index 4dda3090b78..86fa99f4f4b 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -379,7 +379,8 @@ $string['cronclionly'] = 'Cron execution via command line only'; $string['cronerrorclionly'] = 'Sorry, internet access to this page has been disabled by the administrator.'; $string['cronerrorpassword'] = 'Sorry, you have not provided a valid password to access this page'; $string['cronremotepassword'] = 'Cron password for remote access'; -$string['cronwarning'] = 'The cron.php maintenance script has not been run for at least 24 hours.'; +$string['cronwarning'] = 'The cron.php maintenance script has not been run for at least 24 hours.'; +$string['cronwarningcli'] = 'The cli/cron.php maintenance script has not been run for at least 24 hours.'; $string['ctyperequired'] = 'The ctype PHP extension is now required by Moodle, in order to improve site performance and to offer multilingual compatibility.'; $string['curlcache'] = 'cURL cache TTL'; $string['curlrequired'] = 'The cURL PHP extension is now required by Moodle, in order to communicate with Moodle repositories.';