/** returns the value for $string **/
- function getPref($data_dir, $username, $string) {
+ function getPref($data_dir, $username, $string, $default = '') {
global $prefs_cache;
-
+
cachePrefValues($data_dir, $username);
-
+
if (isset($prefs_cache[$string]))
return $prefs_cache[$string];
- return '';
+ else
+ return $default;
}
global $prefs_cache;
cachePrefValues($data_dir, $username);
- if ($prefs_cache[$string] == $set_to)
+ if (isset($prefs_cache[$string]) && $prefs_cache[$string] == $set_to)
return;
- if ($set_to == '') {
+ if ($set_to === '') {
removePref($data_dir, $username, $string);
return;
}
}
return $sig;
}
-?>
+?>
\ No newline at end of file