From: robsiemb Date: Fri, 11 Oct 2002 14:28:07 +0000 (+0000) Subject: add get_pref and get_pref_override plugin hooks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=397a9d7b0815421a4154b6dfbb1f84bf0fa2d347;p=squirrelmail.git add get_pref and get_pref_override plugin hooks git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3840 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/file_prefs.php b/functions/file_prefs.php index 0671b3ef..073b366a 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -79,12 +79,19 @@ function getPref($data_dir, $username, $string, $default = '') { global $prefs_cache; $result = ''; - cachePrefValues($data_dir, $username); + $result = do_hook_function('get_pref_override', array($username, $string)); - if (isset($prefs_cache[$string])) { - $result = $prefs_cache[$string]; - } else { - $result = $default; + if ($result == '') { + cachePrefValues($data_dir, $username); + + if (isset($prefs_cache[$string])) { + $result = $prefs_cache[$string]; + } else { + $result = do_hook_function('get_pref', array($username, $string)); + if ($result == '') { + $result = $default; + } + } } return ($result);