MDL-44312 Administration Take care of cronclionly and cronremotepassword.

This commit is contained in:
Matteo Scaramuccia 2014-02-22 13:54:19 +01:00
parent 76e4de31cc
commit ed25d7c411
2 changed files with 15 additions and 2 deletions

View File

@ -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'));
}

View File

@ -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 <a href="cron.php">cron.php maintenance script</a> has not been run for at least 24 hours.';
$string['cronwarning'] = 'The <a href="{$a}">cron.php maintenance script</a> 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.';