X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Foptions.php;h=fd6e2fd6dac937052655af4e914a5157fca67f3f;hb=aa48e1fb0c6e2d10812a2aa60ad805fecae83be7;hp=7617b2bc41adb79c93b891ab9434def182232b8b;hpb=76911253eb850bacde3d86c8cb7b4af072e67ebe;p=squirrelmail.git diff --git a/functions/options.php b/functions/options.php index 7617b2bc..fd6e2fd6 100644 --- a/functions/options.php +++ b/functions/options.php @@ -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); }