// Whether or not to use META tags and automatically forward after an action has
// been completed.
$auto_forward = true;
+
+// Path to the data/ directory
+// It is a possible security hole to have a writable directory under the web server's
+// root directory (ex: /home/httpd/html). For this reason, it is possible to put
+// the data directory anywhere you would like. The path name can be absolute or
+// relative (to the config directory). It doesn't matter. Here are two examples:
+//
+// Absolute:
+// $data_dir = "/usr/local/squirrelmail/data/";
+//
+// Relative (to the config directory):
+// $data_dir = "../data/";
+
+ $data_dir = "../data/haha/";
?>
**/
/** returns the value for $string **/
- function getPref($username, $string) {
- $filename = "../data/$username.pref";
+ function getPref($data_dir, $username, $string) {
+ $filename = "$data_dir$username.pref";
if (!file_exists($filename)) {
echo "Preference file \"$filename\" not found. Exiting abnormally";
exit;
}
/** sets the pref, $string, to $set_to **/
- function setPref($username, $string, $set_to) {
- $filename = "../data/$username.pref";
+ function setPref($data_dir, $username, $string, $set_to) {
+ $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>";
}
/** This checks if there is a pref file, if there isn't, it will create it. **/
- function checkForPrefs($username) {
- $filename = "../data/$username.pref";
+ function checkForPrefs($data_dir, $username) {
+ $filename = "$data_dir$username.pref";
if (!file_exists($filename)) {
- if (!copy("../data/default_pref", $filename)) {
+ if (!copy("$data_dirdefault_pref", $filename)) {
echo "Error opening $filename";
exit;
}
$bcc = parseAddrs($b);
$body = stripslashes($body);
$from_addr = "$username@$domain";
- $reply_to = getPref($username, "reply_to");
- $from = getPref($username, "full_name");
+ $reply_to = getPref($data_dir, $username, "reply_to");
+ $from = getPref($data_dir, $username, "full_name");
if ($from == "")
$from = "<$from_addr>";
else
<?
+ include("../config/config.php");
include("../functions/prefs.php");
- $chosen_theme = getPref($username, "chosen_theme");
+ $chosen_theme = getPref($data_dir, $username, "chosen_theme");
if (isset($chosen_theme)) {
require("$chosen_theme");
displayPageHeader($color, "None");
/** load up some of the values from the pref file **/
- $fullname = getPref($username, "full_name");
- $replyto = getPref($username, "reply_to");
+ $fullname = getPref($data_dir, $username, "full_name");
+ $replyto = getPref($data_dir, $username, "reply_to");
if ($replyto == "")
$replyto = "$username@$domain";
echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
displayPageHeader($color, "None");
- setPref($username, "full_name", $full_name);
- setPref($username, "reply_to", $reply_to);
- setPref($username, "chosen_theme", $chosentheme);
+ setPref($data_dir, $username, "full_name", $full_name);
+ setPref($data_dir, $username, "reply_to", $reply_to);
+ setPref($data_dir, $username, "chosen_theme", $chosentheme);
echo "<FONT FACE=\"Arial,Helvetica\">";
echo "<BR><BR><BR><CENTER><B>Options Saved!</B><BR><BR>";
we would like to use as little Javascript as possible.
**/
<?
- checkForPrefs($username);
+ checkForPrefs($data_dir, $username);
if ($right_frame == "right_main.php") {
$urlMailbox = urlencode($mailbox);