3. Edit the config file, config/config.php
-4. Point your browser to the location you specified in step 2.
+4. Change the permissons for the "data/" directory so it's writable to
+ the web server. Under Red Hat Linux 6.0, this is done by:
+
+ chown nobody data
+ chgrp nobody data
+
+ "nobody" is the user and group for the apache server for this
+ example.
+
+5. Point your browser to the location you specified in step 2.
In this example, it's: http://YOURHOST/squirrelmail-0.1/index.html
echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"compose.php\">Compose</A></FONT>  ";
echo " <FONT FACE=\"Arial,Helvetica\">Addresses</FONT>  ";
echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"folders.php\">Folders</A></FONT>  ";
- echo " <FONT FACE=\"Arial,Helvetica\">Options</FONT>  ";
+ echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"options.php\">Options</A></FONT>  ";
echo " </TD><TD ALIGN=right WIDTH=30%>";
echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A></FONT>";
echo " </TD>";
--- /dev/null
+<?
+ /**
+ ** prefs.php
+ **
+ ** This contains functions for manipulating user preferences
+ **/
+
+ /** returns the value for $string **/
+ function getPref($username, $string) {
+ $filename = "../data/$username.pref";
+ $file = fopen($filename, "r");
+
+ /** read in all the preferences **/
+ for ($i=0; !feof($file); $i++) {
+ $pref = fgets($file, 1024);
+ if (substr($pref, 0, strpos($pref, "=")) == $string) {
+ fclose($file);
+ return substr($pref, strpos($pref, "=")+1);
+ }
+ }
+ fclose($file);
+ return "";
+ }
+
+ /** sets the pref, $string, to $set_to **/
+ function setPref($username, $string, $set_to) {
+ $filename = "../data/$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>";
+ exit;
+ }
+ $file = fopen($filename, "r");
+
+ /** read in all the preferences **/
+ for ($i=0; !feof($file); $i++) {
+ $pref[$i] = fgets($file, 1024);
+ if (substr($pref[$i], 0, strpos($pref[$i], "=")) == $string) {
+ $found = true;
+ $pos = $i;
+ }
+ }
+ fclose($file);
+
+ $file = fopen($filename, "w");
+ if ($found == true) {
+ for ($i=0; $i < count($pref); $i++) {
+ if ($i == $pos) {
+ fwrite($file, "$string=$set_to\n", 1024);
+ } else {
+ fwrite($file, "$pref[$i]", 1024);
+ }
+ }
+ } else {
+ for ($i=0; $i < count($pref); $i++) {
+ fwrite($file, "$pref[$i]", 1024);
+ }
+ fwrite($file, "$string=$set_to\n", 1024);
+ }
+
+ fclose($file);
+ }
+
+ /** This checks if there is a pref file, if there isn't, it will create it. **/
+ function checkForPrefs($username) {
+ $filename = "../data/default_pref";
+ if (!file_exists($filename)) {
+ if (!copy("../config/default.pref", $filename)) {
+ echo "Error opening $filename";
+ exit;
+ }
+ }
+ return;
+ }
+?>
\ No newline at end of file
--- /dev/null
+<?
+ include("../config/config.php");
+ include("../functions/mailbox.php");
+ include("../functions/strings.php");
+ include("../functions/page_header.php");
+ include("../functions/display_messages.php");
+ include("../functions/imap.php");
+ include("../functions/array.php");
+ include("../functions/prefs.php");
+
+ echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
+ displayPageHeader($color, "None");
+
+ echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
+ echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
+ echo " <FONT FACE=\"Arial,Helvetica\">Options</FONT>\n";
+ echo " </TD></TR>\n";
+ echo "</TABLE>\n";
+
+ echo getPref($username, "full_name");
+
+ echo "</BODY></HTML>";
+?>
\ No newline at end of file