* Configuration of databasename, username and password is done
* by using conf.pl or the administrator plugin
*
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2010 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
if (!empty($prefs_user_field)) {
$this->user_field = $prefs_user_field;
}
+
+ // the default user field is "user", which in PostgreSQL
+ // is an identifier and causes errors if not escaped
+ //
+ if ($this->db_type == SMDB_PGSQL) {
+ $this->user_field = '"' . $this->user_field . '"';
+ }
+
if (!empty($prefs_key_field)) {
$this->key_field = $prefs_key_field;
}
function getKey($user, $key, $default = '') {
global $prefs_cache;
- cachePrefValues($user);
+ $temp = array(&$user, &$key);
+ $result = do_hook('get_pref_override', $temp);
+ if (is_null($result)) {
+ cachePrefValues($user);
- if (isset($prefs_cache[$key])) {
- return $prefs_cache[$key];
- } else {
- if (isset($this->default[$key])) {
- return $this->default[$key];
+ if (isset($prefs_cache[$key])) {
+ $result = $prefs_cache[$key];
} else {
- return $default;
+//FIXME: is there a justification for having two prefs hooks so close? who uses them?
+ $temp = array(&$user, &$key);
+ $result = do_hook('get_pref', $temp);
+ if (is_null($result)) {
+ if (isset($this->default[$key])) {
+ $result = $this->default[$key];
+ } else {
+ $result = $default;
+ }
+ }
}
}
+ return $result;
}
/**