Moved theme changing to after SESSION exists

This commit is contained in:
moodler
2005-02-01 08:00:58 +00:00
parent c6a2a401ed
commit 18b9d66439
+18 -16
View 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