Changed temp file write to from due to leftover file possiblity, At least they...
[squirrelmail.git] / src / options_submit.php
index ff32aff6854b40f46fe005d5c92d65a1ff740ede..ea4276f1330b2336a81620b0ef97fc1b1c011aba 100644 (file)
@@ -1,31 +1,67 @@
-<?
-   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");
+<?php
+   session_start();
+
+   if (!isset($config_php))
+      include("../config/config.php");
+   if (!isset($strings_php))
+      include("../functions/strings.php");
+   if (!isset($page_header_php))
+      include("../functions/page_header.php");
+   if (!isset($dipslay_messages_php))
+      include("../functions/display_messages.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
+   if (!isset($auth_php))
+      include ("../functions/auth.php");
 
    include("../src/load_prefs.php");
 
-   echo "<HTML>";
-   echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
-   displayPageHeader($color, "None");
+   is_logged_in();
 
-   setPref($data_dir, $username, "full_name", $full_name);
-   setPref($data_dir, $username, "reply_to", $reply_to);
+   setPref($data_dir, $username, "full_name", stripslashes($full_name));
+   setPref($data_dir, $username, "email_address", stripslashes($email_address));
+   setPref($data_dir, $username, "reply_to", stripslashes($reply_to));
    setPref($data_dir, $username, "chosen_theme", $chosentheme);
-   setPref($data_dir, $username, "move_to_trash", $movetotrash);
+   setPref($data_dir, $username, "show_num", $shownum);
    setPref($data_dir, $username, "wrap_at", $wrapat);
    setPref($data_dir, $username, "editor_size", $editorsize);
    setPref($data_dir, $username, "use_signature", $usesignature);
+   setPref($data_dir, $username, "left_refresh", $leftrefresh);
+   setPref($data_dir, $username, "language", $language);
+   setPref($data_dir, $username, "left_size", $leftsize);
+   setPref($data_dir, $username, "folder_prefix", $folderprefix);
+   setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
 
-   setSig($data_dir, $username, $signature_edit);
+       if ($trash != "none") {
+       setPref($data_dir, $username, "move_to_trash", true);
+               setPref($data_dir, $username, "trash_folder", $trash);
+       } else {
+       setPref($data_dir, $username, "move_to_trash", false);
+               setPref($data_dir, $username, "trash_folder", "");
+       }
+   
+       if ($sent != "none") {
+       setPref($data_dir, $username, "move_to_sent", true);
+               setPref($data_dir, $username, "sent_folder", $sent);
+       } else {
+       setPref($data_dir, $username, "move_to_sent", false);
+               setPref($data_dir, $username, "sent_folder", "");
+       }
+   
+   setSig($data_dir, $username, stripslashes($signature_edit));
 
-   echo "<FONT FACE=\"Arial,Helvetica\">";
-   echo "<BR><BR><BR><CENTER><B>Options Saved!</B><BR><BR>";
-   echo "Your options have been saved.<BR><A HREF=\"webmail.php\" TARGET=_top>Click here</A> to continue.";
-   echo "</CENTER></FONT>";
+   setcookie("squirrelmail_language", $language, time()+2592000);
+   $squirrelmail_language = $language;
+
+   displayPageHeader($color, "None");
+   echo "<BR><BR><BR><CENTER><B>";
+   echo _("Options Saved!");
+   echo "</B><BR><BR>";
+   echo _("Your options have been saved.");
+   echo "<BR><A HREF=\"webmail.php\" TARGET=_top>";
+   echo _("Click here");
+   echo "</A> ";
+   echo _("to continue.");
+   echo "</CENTER>";
    echo "</BODY></HTML>";
-?>
\ No newline at end of file
+?>