From dac1660637a39214ab62ef1e83bbca4a5920b0e2 Mon Sep 17 00:00:00 2001 From: ebullient Date: Sat, 4 Jan 2003 03:09:00 +0000 Subject: [PATCH] use new function to get POST variables git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4370 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/options.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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); } -- 2.25.1