Minor fix for people who saw fatal errors trying to overwrite with the rename command.
[squirrelmail.git] / src / options.php
index abf23cc97abee2256a5bb4a7d87acca801893f67..c6dd5c7d31c8b2c1010702723637f6acc9d9b9da 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * options.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Displays the options page. Pulls from proper user preference files
@@ -17,9 +17,9 @@ define('SM_PATH','../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/display_messages.php');
 require_once(SM_PATH . 'functions/imap.php');
-require_once(SM_PATH . 'functions/array.php');
 require_once(SM_PATH . 'functions/options.php');
 require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'functions/html.php');
@@ -116,23 +116,14 @@ function print_optionpages_row($leftopt, $rightopt = false) {
 /* ---------------------------- main ---------------------------- */
 
 /* get the globals that we may need */
-if (isset($_GET['optpage'])) {
-    $optpage = $_GET['optpage'];
-}
-elseif (isset($_POST['optpage'])) {
-    $optpage = $_POST['optpage'];
-}
-if (isset($_POST['optmode'])) {
-    $optmode = $_POST['optmode'];
-}
-if (isset($_POST['optpage_data'])) {
-    $optpage_data = $_POST['optpage_data'];
-}
-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$onetimepad = $_SESSION['onetimepad'];
-$delimiter = $_SESSION['delimiter'];
-
+sqgetGlobalVar('key',       $key,           SQ_COOKIE);
+sqgetGlobalVar('username',  $username,      SQ_SESSION);
+sqgetGlobalVar('onetimepad',$onetimepad,    SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter,     SQ_SESSION);
+
+sqgetGlobalVar('optpage',     $optpage);
+sqgetGlobalVar('optmode',     $optmode,      SQ_POST);
+sqgetGlobalVar('optpage_data',$optpage_data, SQ_POST);
 /* end of getting globals */
 
 /* Make sure we have an Option Page set. Default to main. */