0002032: user_theme() should return default if theme does not exist
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 27 Jan 2013 00:35:23 +0000 (01:35 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 27 Jan 2013 00:35:23 +0000 (01:35 +0100)
includes/prefs/userprefs.inc

index 811e663d454c1948ae7869e7abfeb43dcf6a67ac..e14c08b5cf06bea77bb93e0578507d73e93cb23f 100644 (file)
@@ -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";
                }
        }