From 397a9d7b0815421a4154b6dfbb1f84bf0fa2d347 Mon Sep 17 00:00:00 2001 From: robsiemb Date: Fri, 11 Oct 2002 14:28:07 +0000 Subject: [PATCH] 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 --- functions/file_prefs.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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); -- 2.25.1