X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=85598f107123c76774dbf2d57ec776bed42b529f;hb=a2e66c6d35a0a73d8d9f48af1288a34f83219ec6;hp=5bdedadb0eee282d31ad0f8a576dba2f2091c4ad;hpb=fb69468112601468596fa23e00f247ac622f7770;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 5bdedadb..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 ( !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); }