From 403f0bf771d022964412bb646532c19431710d65 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 19 May 2011 06:06:46 -0400
Subject: [PATCH] - Fix default_port option handling in Installer when config.inc.php file exists (#1487925)
---
CHANGELOG | 1 +
installer/rcube_install.php | 13 +++++++------
installer/index.php | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 39d5867..53515f6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix default_port option handling in Installer when config.inc.php file exists (#1487925)
- Removed option focus_on_new_message, added newmail_notifier plugin
- Added general rcube_cache class with Memcache and APC support
- Improved caching performance by skipping writes of unchanged data
diff --git a/installer/index.php b/installer/index.php
index e09b827..8df7ab0 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -41,7 +41,7 @@
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="'.$filename.'"');
-
+
$RCI->merge_config();
echo $RCI->create_config($_GET['_mergeconfig'], true);
exit;
diff --git a/installer/rcube_install.php b/installer/rcube_install.php
index 8ff6492..c8c103a 100644
--- a/installer/rcube_install.php
+++ b/installer/rcube_install.php
@@ -123,8 +123,8 @@
return $value !== null && $value !== '' ? $value : $default;
}
-
-
+
+
/**
* Take the default config file and replace the parameters
* with the submitted form data
@@ -135,13 +135,14 @@
function create_config($which, $force = false)
{
$out = @file_get_contents(RCMAIL_CONFIG_DIR . "/{$which}.inc.php.dist");
-
+
if (!$out)
return '[Warning: could not read the config template file]';
foreach ($this->config as $prop => $default) {
+
$value = (isset($_POST["_$prop"]) || $this->bool_config_props[$prop]) ? $_POST["_$prop"] : $default;
-
+
// convert some form data
if ($prop == 'debug_level') {
$val = 0;
@@ -193,9 +194,9 @@
else if (is_numeric($value)) {
$value = intval($value);
}
-
+
// skip this property
- if (!$force && ($value == $default))
+ if (!$force && !$this->configured && ($value == $default))
continue;
// save change
--
Gitblit v1.9.1