<?php
include("global.php");
### set_theme.php ###
// writes the client's chosen theme in a cookie variable
// sets url decoded variable for the rest of the script
if(!isset($theme)) { $theme = "$DEFAULT_THEME"; }
$theme = stripslashes(rawurldecode($theme));
// These lines are ESSENTIAL for the brunhilde server remain secure
// They keep a client from entering "../" to gain access to files
// outside of your web tree
if((substr_count($theme, "../") > 0) || (substr_count($theme, "..\\") > 0)) {
include("security.php");
}
// writes the theme variable in the user's cookie
// makes the cookie last until this script is obsolete
$cookie_time = mktime(0, 0, 0, 12, 30, 2032);
// writes the playlists contents to the cookie
setcookie("CLIENT_THEME", $theme, $cookie_time);
// sends the user back to the main page
header("Content-Type: text/html");
header("location: index.php");
exit;
?>