Skip to content

Commit

Permalink
A SESSION->theme can be set (only with sesskey)
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 30, 2005
1 parent 8ba55c0 commit 1e92ee7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/setup.php
Expand Up @@ -212,23 +212,31 @@


/// 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';
}
include($CFG->dirroot .'/theme/'. $CFG->theme .'/config.php');
$currenttheme = current_theme();
include($CFG->dirroot .'/theme/'. $currenttheme .'/config.php');

if (empty($CFG->custompix)) { // Could be set in the above file
$CFG->pixpath = $CFG->wwwroot .'/pix';
$CFG->modpixpath = $CFG->wwwroot .'/mod';
} else {
$CFG->pixpath = $CFG->wwwroot .'/theme/'. $CFG->theme .'/pix';
$CFG->modpixpath = $CFG->wwwroot .'/theme/'. $CFG->theme .'/pix/mod';
$CFG->pixpath = $CFG->wwwroot .'/theme/'. $currenttheme .'/pix';
$CFG->modpixpath = $CFG->wwwroot .'/theme/'. $currenttheme .'/pix/mod';
}

$CFG->stylesheet = $CFG->wwwroot .'/theme/'. $CFG->theme .'/styles.php';
$CFG->header = $CFG->dirroot .'/theme/'. $CFG->theme .'/header.html';
$CFG->footer = $CFG->dirroot .'/theme/'. $CFG->theme .'/footer.html';
$CFG->stylesheet = $CFG->wwwroot .'/theme/'. $currenttheme .'/styles.php';
$CFG->header = $CFG->dirroot .'/theme/'. $currenttheme .'/header.html';
$CFG->footer = $CFG->dirroot .'/theme/'. $currenttheme .'/footer.html';


/// A hack to get around magic_quotes_gpc being turned off
Expand Down

0 comments on commit 1e92ee7

Please sign in to comment.