|
@@ -89,26 +89,26 @@
|
|
|
|
|
|
function removePref($data_dir, $username, $string) {
|
|
function removePref($data_dir, $username, $string) {
|
|
global $prefs_cache;
|
|
global $prefs_cache;
|
|
-
|
|
|
|
|
|
+
|
|
cachePrefValues($data_dir, $username);
|
|
cachePrefValues($data_dir, $username);
|
|
-
|
|
|
|
|
|
+
|
|
if (isset($prefs_cache[$string])) {
|
|
if (isset($prefs_cache[$string])) {
|
|
unset($prefs_cache[$string]);
|
|
unset($prefs_cache[$string]);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
savePrefValues($data_dir, $username);
|
|
savePrefValues($data_dir, $username);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/** sets the pref, $string, to $set_to **/
|
|
/** sets the pref, $string, to $set_to **/
|
|
function setPref($data_dir, $username, $string, $set_to) {
|
|
function setPref($data_dir, $username, $string, $set_to) {
|
|
global $prefs_cache;
|
|
global $prefs_cache;
|
|
-
|
|
|
|
|
|
+
|
|
cachePrefValues($data_dir, $username);
|
|
cachePrefValues($data_dir, $username);
|
|
if (isset($prefs_cache[$string]) && $prefs_cache[$string] == $set_to)
|
|
if (isset($prefs_cache[$string]) && $prefs_cache[$string] == $set_to)
|
|
return;
|
|
return;
|
|
if ($set_to === '') {
|
|
if ($set_to === '') {
|
|
removePref($data_dir, $username, $string);
|
|
removePref($data_dir, $username, $string);
|
|
- return;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
$prefs_cache[$string] = $set_to;
|
|
$prefs_cache[$string] = $set_to;
|
|
savePrefValues($data_dir, $username);
|
|
savePrefValues($data_dir, $username);
|
|
@@ -119,7 +119,7 @@
|
|
create it. **/
|
|
create it. **/
|
|
function checkForPrefs($data_dir, $username) {
|
|
function checkForPrefs($data_dir, $username) {
|
|
$filename = $data_dir . $username . '.pref';
|
|
$filename = $data_dir . $username . '.pref';
|
|
- if (!file_exists($filename)) {
|
|
|
|
|
|
+ if (!file_exists($filename) ) {
|
|
if (!copy($data_dir . 'default_pref', $filename)) {
|
|
if (!copy($data_dir . 'default_pref', $filename)) {
|
|
echo _("Error opening ") . $filename;
|
|
echo _("Error opening ") . $filename;
|
|
exit;
|
|
exit;
|
|
@@ -150,4 +150,5 @@
|
|
}
|
|
}
|
|
return $sig;
|
|
return $sig;
|
|
}
|
|
}
|
|
-?>
|
|
|
|
|
|
+
|
|
|
|
+?>
|