$chosen_theme_path = 'u_'.$user_themes[$user_theme_default]['PATH'] :
$chosen_theme;
+// Make sure the chosen theme is a legitimate one.
// need to adjust $chosen_theme path with SM_PATH
$chosen_theme_path = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme_path);
$k = 0;
}
*/
+
// user's icon theme, if using icons
-$icon_theme = getPref($data_dir, $username, 'icon_theme', 'images/themes/xp/' );
+$icon_theme = getPref($data_dir, $username, 'icon_theme');
+$default_icon_theme = $icon_themes[$icon_theme_def]['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);
+$k = 0;
+while (!$found_theme && $k < count($icon_themes)) {
+ if ($icon_themes[$k]['PATH'] == $icon_theme)
+ $found_theme = true;
+ $k++;
+}
+if (!$found_theme) {
+ $icon_theme = $default_icon_theme;
+}
/*
* NOTE: The $icon_theme_path var should contain the path to the icon
define('SMOPT_GRP_MAILBOX', 1);
define('SMOPT_GRP_MESSAGE', 2);
-/**
- * Icon themes and user CSS themes should probably both be moved to conf.pl
- *
- * TODO: move to conf.pl
- **/
-// load icon themes if in use
-global $use_icons;
-if ($use_icons) {
- global $icon_themes;
- $dirName = SM_PATH . 'images/themes';
- if (is_readable($dirName) && is_dir($dirName)) {
- $d = dir($dirName);
- while($dir = $d->read()) {
- if ($dir != "." && $dir != "..") {
- if (is_dir($dirName."/".$dir) && file_exists("$dirName/$dir/theme.php"))
- include("$dirName/$dir/theme.php");
- }
- }
- }
-}
-
global $use_iframe;
if (! isset($use_iframe)) $use_iframe=false;
function load_optpage_data_display() {
global $theme, $fontsets, $language, $languages,$aTemplateSet,
$default_use_mdn, $squirrelmail_language, $allow_thread_sort,
- $show_alternative_names, $use_icons, $use_iframe, $sTemplateID,
- $oTemplate, $user_themes, $chosen_theme;
+ $show_alternative_names, $use_iframe, $use_icons,
+ $sTemplateID, $oTemplate,
+ $user_themes, $chosen_theme;
/* Build a simple array into which we will build options. */
$optgrps = array();
* @since 1.5.2
*/
function getIconPath ($icon_theme_path, $icon_name) {
- global $icon_theme_def;
+ global $default_icon_theme;
if (is_null($icon_theme_path))
return NULL;
return $icon_theme_path . $icon_name;
// Icon not found, check for the admin-specified default
- } elseif (!is_null($icon_theme_def) && is_file($icon_theme_def . $icon_name)) {
- return $icon_theme_def . $icon_name;
+ } elseif (!is_null($default_icon_theme) && is_file($default_icon_theme . $icon_name)) {
+ return $default_icon_theme . $icon_name;
// Icon not found, return the SQM default icon
} elseif (is_file(SM_PATH . 'images/themes/default/'.$icon_name)) {