X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdb_prefs.php;h=87990fddb2a7068c9f8b0860f7cffbb1b5235196;hb=e506b6e54f09ec71062b55bf3d72c9db57c89f05;hp=d78606974a0846a28258cecffb721b4fdc0fe03a;hpb=3ec364a47fc7fa5061df72a84123c7ded037a3a4;p=squirrelmail.git diff --git a/functions/db_prefs.php b/functions/db_prefs.php index d7860697..87990fdd 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -21,7 +21,7 @@ * 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-2009 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -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; } /**