projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed line breaks that didn't allow xgetpo to work
[squirrelmail.git]
/
functions
/
prefs.php
diff --git
a/functions/prefs.php
b/functions/prefs.php
index 72f3c445995c126c0f5f76e69b1b88d4277477fb..1b70943c8d1bb086bce7dede3088981431b7fffb 100644
(file)
--- a/
functions/prefs.php
+++ b/
functions/prefs.php
@@
-1,16
+1,16
@@
<?php
<?php
+
/**
** prefs.php
**
/**
** prefs.php
**
+ ** Copyright (c) 1999-2001 The Squirrelmail Development Team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
+ **
** This contains functions for manipulating user preferences
**
** $Id$
**/
** This contains functions for manipulating user preferences
**
** $Id$
**/
- if (defined('prefs_php'))
- return;
- define('prefs_php', true);
-
global $prefs_are_cached, $prefs_cache;
if (!session_is_registered('prefs_are_cached')) {
$prefs_are_cached = false;
global $prefs_are_cached, $prefs_cache;
if (!session_is_registered('prefs_are_cached')) {
$prefs_are_cached = false;
@@
-62,14
+62,15
@@
/** returns the value for $string **/
/** returns the value for $string **/
- function getPref($data_dir, $username, $string) {
+ function getPref($data_dir, $username, $string
, $default = ''
) {
global $prefs_cache;
global $prefs_cache;
-
+
cachePrefValues($data_dir, $username);
cachePrefValues($data_dir, $username);
-
+
if (isset($prefs_cache[$string]))
return $prefs_cache[$string];
if (isset($prefs_cache[$string]))
return $prefs_cache[$string];
- return '';
+ else
+ return $default;
}
}
@@
-105,7
+106,7
@@
cachePrefValues($data_dir, $username);
if (isset($prefs_cache[$string]) && $prefs_cache[$string] == $set_to)
return;
cachePrefValues($data_dir, $username);
if (isset($prefs_cache[$string]) && $prefs_cache[$string] == $set_to)
return;
- if ($set_to == '') {
+ if ($set_to ==
=
'') {
removePref($data_dir, $username, $string);
return;
}
removePref($data_dir, $username, $string);
return;
}