From: pdontthink Date: Mon, 23 Jun 2008 19:57:55 +0000 (+0000) Subject: Someone added some prefs hooks to the file-based prefs backend but never added them... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=971c7b1a4c7b9845e1b2408757c9c2e58b15fb2e;p=squirrelmail.git Someone added some prefs hooks to the file-based prefs backend but never added them to the db-based one - fix that git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13193 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/db_prefs.php b/functions/db_prefs.php index d7860697..71422f13 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -278,17 +278,27 @@ class dbPrefs { 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; } /**