use new function to get POST variables
authorebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 4 Jan 2003 03:09:00 +0000 (03:09 +0000)
committerebullient <ebullient@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 4 Jan 2003 03:09:00 +0000 (03:09 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4370 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/options.php

index 7617b2bc41adb79c93b891ab9434def182232b8b..fd6e2fd6dac937052655af4e914a5157fca67f3f 100644 (file)
@@ -91,9 +91,7 @@ class SquirrelOption {
         }
 
         /* Check for a new value. */
-        if (isset($_POST["new_$name"])) {
-            $this->new_value = $_POST["new_$name"];
-        } else {
+       if ( !sqgetGlobalVar("new_$name", $this->new_value, SQ_POST ) ) {
             $this->new_value = '';
         }
 
@@ -330,12 +328,11 @@ class SquirrelOption {
 }
 
 function save_option($option) {
-    if ( !check_php_version(4,1) ) {
-        global $_SESSION;
+    if ( !sqgetGlobalVar('username', $username, SQ_SESSION ) ) {
+        /* Can't save the pref if we don't have the username */
+        return;
     }
     global $data_dir;
-    $username = $_SESSION['username'];
-
     setPref($data_dir, $username, $option->name, $option->new_value);
 }