59177427 |
1 | <?php |
2ba13803 |
2 | |
35586184 |
3 | /** |
4 | * prefs.php |
5 | * |
15e6162e |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
35586184 |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * This contains functions for manipulating user preferences |
10 | * |
11 | * $Id$ |
12 | */ |
13 | |
35586184 |
14 | global $prefs_are_cached, $prefs_cache; |
15 | if (!session_is_registered('prefs_are_cached')) { |
16 | $prefs_are_cached = false; |
17 | $prefs_cache = array(); |
18 | } |
31ac7db8 |
19 | |
7b294953 |
20 | /** |
21 | * Check the preferences into the session cache. |
22 | */ |
23 | function cachePrefValues($data_dir, $username) { |
24 | global $prefs_are_cached, $prefs_cache; |
31ac7db8 |
25 | |
7b294953 |
26 | if ($prefs_are_cached) { |
27 | return; |
28 | } |
29 | |
165829a3 |
30 | /* A call to checkForPrefs here should take eliminate the need for |
31 | /* this to be called throughout the rest of the SquirrelMail code. |
32 | checkForPrefs($data_dir, $username); |
33 | |
34 | /* Calculate the filename for the user's preference file */ |
3392dc86 |
35 | $filename = getHashedFile($username, $data_dir, "$username.pref"); |
7b294953 |
36 | |
a2a7852b |
37 |