X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=85598f107123c76774dbf2d57ec776bed42b529f;hb=32485e5ee6413a19b736d0e08607884d193a7ff8;hp=1828271598096f724798f3f91bcfcffaeec97ab8;hpb=be2d549570f1501e50b89557351aa3b0372e2e36;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 18282715..85598f10 100644 --- a/functions/options.php +++ b/functions/options.php @@ -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. * * Functions needed to display the options pages. @@ -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 ( (float)substr(PHP_VERSION,0,3) < 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); }