From 27564f1a22d42cdcdb1d2972ca79cc537876c44c Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Thu, 28 Feb 2008 16:52:57 -0500 Subject: [PATCH] Add IMAP test and some more options to installer script --- installer/rcube_install.php | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 65fbe09..e02ee75 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -29,6 +29,7 @@ var $configured = false; var $last_error = null; var $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])'; + var $config_props = array(); /** * Constructor @@ -97,7 +98,7 @@ */ function getprop($name, $default = '') { - $value = isset($_REQUEST["_$name"]) ? $_REQUEST["_$name"] : $this->config[$name]; + $value = $_SERVER['REQUEST_METHOD'] == 'POST' ? $_POST["_$name"] : $this->config[$name]; if ($name == 'des_key' && !isset($_REQUEST["_$name"])) $value = self::random_key(24); @@ -121,7 +122,7 @@ return '[Warning: could not read the template file]'; foreach ($this->config as $prop => $default) { - $value = $_POST["_$prop"] ? $_POST["_$prop"] : $default; + $value = (isset($_POST["_$prop"]) || $this->config_props[$prop]) ? $_POST["_$prop"] : $default; // convert some form data if ($prop == 'debug_level' && is_array($value)) { @@ -148,7 +149,10 @@ $value = '%p'; } else if (is_bool($default)) { - $value = is_numeric($value) ? (bool)$value : $value; + $value = (bool)$value; + } + else if (is_numeric($value)) { + $value = intval($value); } // skip this property -- Gitblit v1.9.1