<?php
-/*
+/**
* db_prefs.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains functions for manipulating user preferences
* by using conf.pl or the administrator plugin
*
* $Id$
+ * @package squirrelmail
*/
+/** Unknown database */
define('SMDB_UNKNOWN', 0);
+/** MySQL */
define('SMDB_MYSQL', 1);
+/** PostgreSQL */
define('SMDB_PGSQL', 2);
require_once('DB.php');
sqsession_register($prefs_are_cached, 'prefs_are_cached');
}
+/**
+ * Completely undocumented class - someone document it!
+ * @package squirrelmail
+ */
class dbPrefs {
var $table = 'userprefs';
var $user_field = 'user';
/* 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;
}
global $prefs_cache;
if (isset($prefs_cache[$string]) && ($prefs_cache[$string] == $set_to)) {
- return;
+ return;
}
if ($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;
}