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
$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');