From a15af05b1f9650afe3b8d40b493ea62dd6ea6abb Mon Sep 17 00:00:00 2001 From: thomppj Date: Sun, 23 Dec 2001 17:26:30 +0000 Subject: [PATCH] Fixed a couple of small bugs. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1891 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 2 +- functions/prefs.php | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/config/conf.pl b/config/conf.pl index 6f142521..b5a63cbf 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -231,7 +231,7 @@ if (!$default_unseen_type) { $default_unseen_type = 1; } if (!$config_use_color) { - $config_use_color = 1; + $config_use_color = 0; } if (!$invert_time) { $invert_time = "false"; diff --git a/functions/prefs.php b/functions/prefs.php index 10e29f4a..e71d4e05 100644 --- a/functions/prefs.php +++ b/functions/prefs.php @@ -27,14 +27,14 @@ function cachePrefValues($data_dir, $username) { return; } - /* A call to checkForPrefs here should take eliminate the need for - /* this to be called throughout the rest of the SquirrelMail code. - checkForPrefs($data_dir, $username); - /* Calculate the filename for the user's preference file */ $filename = getHashedFile($username, $data_dir, "$username.pref"); - checkForPrefs($data_dir, $username);ยบ + /* A call to checkForPrefs here should take eliminate the need for + /* this to be called throughout the rest of the SquirrelMail code. + checkForPrefs($data_dir, $username, $filename); + + /* Make sure that the preference file now DOES exist. */ if (!file_exists($filename)) { printf (_("Preference file, %s, does not exist. Log out, and log back in to create a default preference file."), $filename); exit; @@ -143,8 +143,13 @@ function setPref($data_dir, $username, $string, $value) { /** * Check for a preferences file. If one can not be found, create it. */ -function checkForPrefs($data_dir, $username) { - $filename = getHashedFile($username, $data_dir, "$username.pref"); +function checkForPrefs($data_dir, $username, $filename = '') { + /* First, make sure we have the filename. */ + if ($filename == '') { + $filename = getHashedFile($username, $data_dir, "$username.pref"); + } + + /* Then, check if the file exists. */ if (!file_exists($filename) ) { if (!copy($data_dir . 'default_pref', $filename)) { echo _("Error opening ") . $filename; -- 2.25.1