Merge branch 'm27_MDL-44312_cron_overdue_warning_Does_Not_Take_Care_Of_cronclionly_And_cronremotepassword' of https://github.com/scara/moodle

This commit is contained in:
Damyon Wiese
2014-03-05 13:35:14 +08:00
2 changed files with 15 additions and 2 deletions
+13 -1
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'));
}
+2 -1
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.';