]> git.mjollnir.org Git - moodle.git/commitdiff
Ported from MOODLE_14_STABLE - Show a warning to admins if cron.php hasn't been run
authormartinlanghoff <martinlanghoff>
Mon, 17 Jan 2005 20:59:17 +0000 (20:59 +0000)
committermartinlanghoff <martinlanghoff>
Mon, 17 Jan 2005 20:59:17 +0000 (20:59 +0000)
admin/index.php
lang/en/admin.php

index 46a9f67fb8ee6f931ec31628df311d2d8b391332..a0a59706a1bc0e8dae8d8dc9a1bd88483a526f2f 100644 (file)
         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");
         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");
index e81850df867a8241a6eb44e4aa4c63f9024af036..1253d592b39a30a8787d79647326732b38095201 100755 (executable)
@@ -11,6 +11,7 @@ $string['calendarsettings'] = 'Calendar';
 $string['confirmation'] = 'Confirmation';
 $string['confirmdeletedst'] = 'Deleting the preset named <strong>$a</strong> 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'] = '<strong>The preset named $a is being used for all users of this site!</strong> 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). <br>If you have not configured it yet, check the installation instructions, in the <em>Set up cron</em> section.';
 $string['dstisapreference'] = 'Each user can choose which preset to use';
 $string['dstisforcedto'] = 'Force all users to use';
 $string['dstpresets'] = 'DST Presets';