Example #1
0
 * code does not handle magic_quotes_gpc=on.
 */
if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) {
    header("Location: ../src/login.php");
    die;
}
if (!sqgetGlobalVar('username', $username, SQ_SESSION)) {
    $username = '';
}
// TODO Get rid of "none" strings when NULL or false should be used, i hate them i hate them i hate them!!!.
$custom_css = getPref($data_dir, $username, 'custom_css', 'none');
// template set setup
//
$sDefaultTemplateID = Template::get_default_template_set();
if (PAGE_NAME == 'squirrelmail_rpc') {
    $sTemplateID = Template::get_rpc_template_set();
} else {
    $sTemplateID = getPref($data_dir, $username, 'sTemplateID', $sDefaultTemplateID);
}
// load user theme
//
$chosen_theme = getPref($data_dir, $username, 'chosen_theme');
$chosen_theme_path = empty($chosen_theme) ? $chosen_theme_path = $user_themes[$user_theme_default]['PATH'] : $chosen_theme;
// user's icon theme, if using icons
$icon_theme = getPref($data_dir, $username, 'icon_theme');
$default_icon_theme = $icon_themes[$icon_theme_def]['PATH'];
$fallback_icon_theme = $icon_themes[$icon_theme_fallback]['PATH'];
$found_theme = false;
// Make sure the chosen icon theme is a legitimate one.
// need to adjust $icon_theme path with SM_PATH
$icon_theme = preg_replace("/(\\.\\.\\/){1,}/", SM_PATH, $icon_theme);