MS Exch can be set up that users have to use DOMAIN/username/mailbox
[squirrelmail.git] / functions / options.php
index 7617b2bc41adb79c93b891ab9434def182232b8b..85598f107123c76774dbf2d57ec776bed42b529f 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 = '';
         }
 
@@ -276,11 +274,15 @@ class SquirrelOption {
     }
 
     function createWidget_Integer() {
-        return ($this->createWidget_String());
+
+        return $this->createWidget_String();
+
     }
 
     function createWidget_Float() {
-        return ($this->createWidget_String());
+        
+        return $this->createWidget_String();
+
     }
 
     function createWidget_Boolean() {
@@ -330,12 +332,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);
 }