From f667ecfe3d239a503415a2dcfe7dce2d95fd2ab3 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:45:45 +0000 Subject: [PATCH] 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. --- index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.php b/index.php index 15dd57e2af..94a4306510 100644 --- a/index.php +++ b/index.php @@ -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(); -- 2.39.5