accesslib 1.9 upgrade: homepage check to see if we need to upgrade

This check adds a DB query _only when the upgrade is pending_. So
for a few minutes at the most.
This commit is contained in:
martinlanghoff
2007-09-19 07:45:45 +00:00
parent c24f4599c3
commit f667ecfe3d
+6
View File
@@ -59,6 +59,12 @@
@require_logout();
redirect("$CFG->wwwroot/$CFG->admin/");
}
// Trigger 1.9 accesslib upgrade?
if ((int)$CFG->version < 2007090700
&& isset($USER->id)
&& is_siteadmin($USER->id)) { // this test is expensive, but is only triggered during the upgrade
redirect("$CFG->wwwroot/$CFG->admin/");
}
if ($CFG->forcelogin) {
require_login();