MDL-27899 Moved initialise_fullme during setup to after sam has been initialised
authorSam Hemelryk <sam@moodle.com>
Mon, 20 Jun 2011 09:40:03 +0000 (17:40 +0800)
committerSam Hemelryk <sam@moodle.com>
Mon, 20 Jun 2011 09:40:03 +0000 (17:40 +0800)
lib/setup.php

index 5c8bcac..ba2d627 100644 (file)
@@ -652,9 +652,6 @@ if (isset($_SERVER['PHP_SELF'])) {
     unset($phppos);
 }
 
-// initialise ME's
-initialise_fullme();
-
 // init session prevention flag - this is defined on pages that do not want session
 if (CLI_SCRIPT) {
     // no sessions in CLI scripts possible
@@ -677,6 +674,10 @@ session_get_instance();
 $SESSION = &$_SESSION['SESSION'];
 $USER    = &$_SESSION['USER'];
 
+// initialise ME's
+// This must presently come AFTER $USER has been set up.
+initialise_fullme();
+
 // Late profiling, only happening if early one wasn't started
 if (!empty($CFG->profilingenabled)) {
     require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');