From: Joe Hunt Date: Sun, 27 Jan 2013 00:35:23 +0000 (+0100) Subject: 0002032: user_theme() should return default if theme does not exist X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=04a87fc9ddc74e3a94c6ceac0d6c0365c70c631e;p=textcart.git 0002032: user_theme() should return default if theme does not exist --- diff --git a/includes/prefs/userprefs.inc b/includes/prefs/userprefs.inc index 811e663..e14c08b 100644 --- a/includes/prefs/userprefs.inc +++ b/includes/prefs/userprefs.inc @@ -51,6 +51,7 @@ class user_prefs $this->theme = 'default'; } else { + global $path_to_root; $this->language = $user["language"]; $_SESSION['language']->set_language($this->language); @@ -82,6 +83,8 @@ class user_prefs $this->sticky_date = 0; $this->startup_tab = "orders"; } + if (!file_exists("$path_to_root/themes/$this->theme")) + $this->theme = "default"; } }