From 35de9e2487f33079015cfc3e34719cb5cf9a9e29 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Mon, 17 Jan 2005 20:59:17 +0000 Subject: [PATCH] Ported from MOODLE_14_STABLE - Show a warning to admins if cron.php hasn't been run --- admin/index.php | 7 ++++++- lang/en/admin.php | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/admin/index.php b/admin/index.php index 46a9f67fb8..a0a59706a1 100644 --- a/admin/index.php +++ b/admin/index.php @@ -264,7 +264,6 @@ error("You need to be an admin user to use this page.", "$CFG->wwwroot/login/index.php"); } - /// At this point everything is set up and the user is an admin, so print menu $stradministration = get_string("administration"); @@ -278,6 +277,12 @@ print_spacer(10,10); } +/// If no recently cron run + $lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules'); + if (time() - $lastcron > 3600 * 24) { + print_simple_box(get_string('cronwarning', 'admin') , 'center'); + } + $table->tablealign = "right"; $table->align = array ("right", "left"); $table->wrap = array ("nowrap", "nowrap"); diff --git a/lang/en/admin.php b/lang/en/admin.php index e81850df86..1253d592b3 100755 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -11,6 +11,7 @@ $string['calendarsettings'] = 'Calendar'; $string['confirmation'] = 'Confirmation'; $string['confirmdeletedst'] = 'Deleting the preset named $a will immediately disable DST for all users of that preset. This could possibly change their perception of time without warning. Are you sure you want to continue?'; $string['confirmdeletedstdefault'] = 'The preset named $a is being used for all users of this site! Deleting it will change their perception of time without warning. Are you sure you want to continue?'; +$string['cronwarning'] = 'The cron.php maintenance script has not run recently (at least not in the last 24 hs).
If you have not configured it yet, check the installation instructions, in the Set up cron section.'; $string['dstisapreference'] = 'Each user can choose which preset to use'; $string['dstisforcedto'] = 'Force all users to use'; $string['dstpresets'] = 'DST Presets'; -- 2.39.5