]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix upgrading from 1.6 not redirecting problem
authortoyomoyo <toyomoyo>
Wed, 8 Nov 2006 06:24:05 +0000 (06:24 +0000)
committertoyomoyo <toyomoyo>
Wed, 8 Nov 2006 06:24:05 +0000 (06:24 +0000)
index.php

index f81fc3922b8e0364427b81fb6434526e9667b0c3..b40fee517f6b1010b31534c356f76320753c7259 100644 (file)
--- a/index.php
+++ b/index.php
         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');
         }
     }