Preferences save now
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 6 Jan 2000 01:12:01 +0000 (01:12 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 6 Jan 2000 01:12:01 +0000 (01:12 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@107 7612ce4b-ef26-0410-bec9-ea0150e637f0

data/default_pref
functions/prefs.php
src/options.php
src/options_submit.php [new file with mode: 0644]

index 3ba5501..b657b22 100644 (file)
@@ -1,3 +1,2 @@
-theme=default_theme.php
 full_name=Luke Ehresman
-reply_to=luke@usa.om.org
\ No newline at end of file
+reply_to=
index 1f6891b..7253092 100644 (file)
@@ -63,9 +63,9 @@
 
    /** This checks if there is a pref file, if there isn't, it will create it. **/
    function checkForPrefs($username) {
-      $filename = "../data/default_pref";
+      $filename = "../data/$username.pref";
       if (!file_exists($filename)) {
-         if (!copy("../config/default.pref", $filename)) {
+         if (!copy("../data/default_pref", $filename)) {
             echo "Error opening $filename";
             exit;
          }
index 3a819a0..34a0bb9 100644 (file)
    echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
    displayPageHeader($color, "None");
 
+   /** load up some of the values from the pref file **/
+   $fullname = getPref($username, "full_name");
+   $replyto  = getPref($username, "reply_to");
+   if ($replyto == "")
+      $replyto = "$username@$domain";
+
    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 "<FORM action=\"options_submit.php\" METHOD=POST>\n";
+   echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
+   // FULL NAME
+   echo "   <TR>";
+   echo "      <TD WIDTH=20% ALIGN=RIGHT BGCOLOR=\"$color[0]\">";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         Full Name:";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "      <TD WIDTH=80% ALIGN=LEFT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         <INPUT TYPE=TEXT NAME=full_name VALUE=\"$fullname\" SIZE=50>";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "   </TR>";
+   // REPLY-TO
+   echo "   <TR>";
+   echo "      <TD WIDTH=20% ALIGN=RIGHT BGCOLOR=\"$color[0]\">";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         Reply-to:";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "      <TD WIDTH=80% ALIGN=LEFT>";
+   echo "         <FONT FACE=\"Arial,Helvetica\">";
+   echo "         <INPUT TYPE=TEXT NAME=reply_to VALUE=\"$replyto\" SIZE=50>";
+   echo "         </FONT>";
+   echo "      </TD>";
+   echo "   </TR>";
+   // SUBMIT BUTTON
+   echo "   <TR>";
+   echo "      <TD WIDTH=20%>";
+   echo "      </TD>";
+   echo "      <TD WIDTH=80% ALIGN=LEFT>";
+   echo "         <INPUT TYPE=SUBMIT VALUE=\"Submit\">\n";
+   echo "      </TD>";
+   echo "   </TR>";
+
+   echo "</TABLE>\n";
+   echo "</FORM>";
 
    echo "</BODY></HTML>";
 ?>
\ No newline at end of file
diff --git a/src/options_submit.php b/src/options_submit.php
new file mode 100644 (file)
index 0000000..687c9ce
--- /dev/null
@@ -0,0 +1,25 @@
+<?
+   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>";
+   if ($auto_forward == true)
+      echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=right_main.php\">";
+   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);
+
+   echo "<FONT FACE=\"Arial,Helvetica\">";
+   echo "<BR><BR><BR><CENTER><B>Options Saved!</B><BR><BR>";
+   echo "You will be automatically forwarded.<BR>If not, <A HREF=\"right_main.php\">click here</A>";
+   echo "</CENTER></FONT>";
+   echo "</BODY></HTML>";
+?>
\ No newline at end of file