Added very basic plugins and themes edition
[squirrelmail.git] / functions / db_prefs.php
index 519f066ff2c1660fdab31704e872c6ebad60e1a7..7bc0800a6e956525d21fbc879c3a7e9c2e78e24c 100644 (file)
@@ -21,7 +21,7 @@
  *    prefkey    char  /  key
  *    prefval    blob
  *
- *   CREATE TABLE userprefs (user CHAR(32) NOT NULL DEFAULT '',
+ *   CREATE TABLE userprefs (user CHAR(128) NOT NULL DEFAULT '',
  *                           prefkey CHAR(64) NOT NULL DEFAULT '',
  *                           prefval BLOB NOT NULL DEFAULT '',
  *                           primary key (user,prefkey));
@@ -119,7 +119,11 @@ class dbPrefs {
         if (isset($prefs_cache[$key])) {
             return $prefs_cache[$key];
         } else {
-            return $default;
+            if (isset($this->default[$key])) {
+                return $this->default[$key];
+            } else {
+                return $default;
+            }
         }
     }
 
@@ -261,7 +265,7 @@ function removePref($data_dir, $username, $string) {
 function setPref($data_dir, $username, $string, $set_to) {
     global $prefs_cache;
 
-    if (isset($prefs_cache[$string]) && ($prefs_cache[$string] == $value)) {
+    if (isset($prefs_cache[$string]) && ($prefs_cache[$string] == $set_to)) {
         return;
     }