]> git.mjollnir.org Git - moodle.git/commitdiff
Moved theme changing to after SESSION exists
authormoodler <moodler>
Tue, 1 Feb 2005 08:00:58 +0000 (08:00 +0000)
committermoodler <moodler>
Tue, 1 Feb 2005 08:00:58 +0000 (08:00 +0000)
lib/setup.php

index 8917a25938db778145e16d34ed2f8f5a0a145657..01267538a3ef8e931c12980ddd01c0b082b357a0 100644 (file)
@@ -211,22 +211,6 @@ global $THEME;
     $CFG->moddata     = 'moddata';
 
 
-/// Load up theme variables (colours etc)
-    if (isset($_GET['theme'])) {
-        if (confirm_sesskey()) {
-            if (!detect_munged_arguments($_GET['theme'], 0) and file_exists($CFG->dirroot .'/theme/'. $_GET['theme'])) {
-                $SESSION->theme = $_GET['theme'];
-            }
-        }
-    }
-
-    if (!isset($CFG->theme)) {
-        $CFG->theme = 'standard';
-    }
-
-    theme_setup();  // Sets up theme global variables
-
-
 /// A hack to get around magic_quotes_gpc being turned off
 
     if (!ini_get_bool('magic_quotes_gpc') ) {
@@ -318,6 +302,24 @@ global $THEME;
 //  session_register("SESSION");
 
 
+
+/// Load up theme variables (colours etc)
+    if (isset($_GET['theme'])) {
+        if (confirm_sesskey()) {
+            if (!detect_munged_arguments($_GET['theme'], 0) and file_exists($CFG->dirroot .'/theme/'. $_GET['theme'])) {
+                $SESSION->theme = $_GET['theme'];
+            }
+        }
+    }
+
+    if (!isset($CFG->theme)) {
+        $CFG->theme = 'standard';
+    }
+
+    theme_setup();  // Sets up theme global variables
+
+
+
 /// Set language/locale of printed times.  If user has chosen a language that 
 /// that is different from the site language, then use the locale specified 
 /// in the language file.  Otherwise, if the admin hasn't specified a locale