PHP 4.3.x prefs fix for db based prefs.
[squirrelmail.git] / functions / db_prefs.php
index ef96837d4a0c7915deadd1e6286461431b24b7ee..960a8bbe2776ea81345ed3bd83fb8c79d8d11449 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * db_prefs.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This contains functions for manipulating user preferences
@@ -290,6 +290,12 @@ function removePref($data_dir, $username, $string) {
     }
 
     $db->deleteKey($username, $string);
+
+    if (isset($prefs_cache[$string])) {
+        unset($prefs_cache[$string]);
+    }
+
+    sqsession_register($prefs_cache , 'prefs_cache');
     return;
 }
 
@@ -316,7 +322,7 @@ function setPref($data_dir, $username, $string, $set_to) {
     assert_options(ASSERT_ACTIVE, 1);
     assert_options(ASSERT_BAIL, 1);
     assert ('$set_to == $prefs_cache[$string]');
-
+    sqsession_register($prefs_cache , 'prefs_cache');
     return;
 }