** prefs.php
**
** This contains functions for manipulating user preferences
+ **
+ ** $Id$
**/
$prefs_php = true;
function getPref($data_dir, $username, $string) {
$filename = "$data_dir$username.pref";
if (!file_exists($filename)) {
- echo _("Preference file ") . "\"$filename\"" . _(" not found. Exiting abnormally");
+ printf (_("Preference file %s not found. Exiting abnormally"), $filename);
exit;
}
$filename = "$data_dir$username.pref";
$found = false;
if (!file_exists($filename)) {
- echo _("Preference file, ") . "\"$filename\"" . _(", does not exist. Log out, and log back in to create a default preference file. ") ."<BR>";
+ printf (_("Preference file, %s, does not exist. Log out, and log back in to create a default preference file."), $filename);
+ echo "<br>\n";
exit;
}
$file = fopen($filename, "r");
fwrite($file, "$pref[$i]", 1024);
}
}
- for ($i=0; $i < count($hlt); $i++) {
- fwrite($file, "highlight$i=$hlt[$i]");
+ if (isset($hlt)) {
+ for ($i=0; $i < count($hlt); $i++) {
+ fwrite($file, "highlight$i=$hlt[$i]");
+ }
}
-
fclose($file);
}
$filename = "$data_dir$username.pref";
$found = false;
if (!file_exists($filename)) {
- echo _("Preference file, ") . "\"$filename\"" . _(", does not exist. Log out, and log back in to create a default preference file. ") ."<BR>";
+ printf (_("Preference file, %s, does not exist. Log out, and log back in to create a default preference file."), $filename);
+ echo "\n<br>\n";
exit;
}
$file = fopen($filename, "r");
/** Gets the signature **/
function getSig($data_dir, $username) {
$filename = "$data_dir$username.sig";
+ $sig = "";
if (file_exists($filename)) {
$file = fopen($filename, "r");
- $sig = "";
while (!feof($file)) {
$sig .= fgets($file, 1024);
}