From: toyomoyo Date: Wed, 8 Nov 2006 06:24:05 +0000 (+0000) Subject: merged fix upgrading from 1.6 not redirecting problem X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=89948e457584e8c7ee57461eed75acd9fb5f3a23;p=moodle.git merged fix upgrading from 1.6 not redirecting problem --- 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'); } }