From 89948e457584e8c7ee57461eed75acd9fb5f3a23 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 8 Nov 2006 06:24:05 +0000 Subject: [PATCH] merged fix upgrading from 1.6 not redirecting problem --- index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index f81fc3922b..b40fee517f 100644 --- a/index.php +++ b/index.php @@ -48,8 +48,14 @@ require_login(); } - if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) { - if (moodle_needs_upgrading()) { + if ($CFG->rolesactive) { // if already using roles system + if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) { + if (moodle_needs_upgrading()) { + redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php'); + } + } + } else { // if upgrading from 1.6 or below + if (isadmin() && moodle_needs_upgrading()) { redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php'); } } -- 2.39.5