X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdb_prefs.php;h=a973f363987285afc38a3eeaa37294f870664ddf;hb=cd33ec110c29e3b7757e4084c71ce05aebfbc23e;hp=ef96837d4a0c7915deadd1e6286461431b24b7ee;hpb=bce23c8671085e00f439f666fbf035a0c4fd7b09;p=squirrelmail.git diff --git a/functions/db_prefs.php b/functions/db_prefs.php index ef96837d..a973f363 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -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 @@ -284,12 +284,19 @@ function getPref($data_dir, $username, $string, $default = '') { /* Remove the pref $string */ function removePref($data_dir, $username, $string) { + global $prefs_cache; $db = new dbPrefs; if(isset($db->error)) { $db->failQuery(); } $db->deleteKey($username, $string); + + if (isset($prefs_cache[$string])) { + unset($prefs_cache[$string]); + } + + sqsession_register($prefs_cache , 'prefs_cache'); return; } @@ -298,7 +305,7 @@ function setPref($data_dir, $username, $string, $set_to) { global $prefs_cache; if (isset($prefs_cache[$string]) && ($prefs_cache[$string] == $set_to)) { - return; + return; } if ($set_to === '') { @@ -316,7 +323,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; }