From 9bacb2cd3f7e8f96a29f651460954965c400aac6 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 28 Jun 2013 16:27:59 -0400
Subject: [PATCH] Prepare config migration: - Show warning in installer and hints how to migrate - Let update.sh create the new config file if legacy config is detected - Provide a sample config file for manual configuration - Define a list of options which always should be written to local config

---
 installer/rcube_install.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/installer/rcube_install.php b/installer/rcube_install.php
index 5d766f4..06622de 100644
--- a/installer/rcube_install.php
+++ b/installer/rcube_install.php
@@ -28,10 +28,12 @@
   var $failures = 0;
   var $config = array();
   var $configured = false;
+  var $legacy_config = false;
   var $last_error = null;
   var $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])';
   var $bool_config_props = array();
 
+  var $local_config = array('db_dsnw', 'default_host', 'support_url', 'des_key', 'plugins');
   var $obsolete_config = array('db_backend', 'double_auth');
   var $replaced_config = array(
     'skin_path'            => 'skin',
@@ -157,6 +159,9 @@
       $is_default = !isset($_POST["_$prop"]);
       $value      = !$is_default || $this->bool_config_props[$prop] ? $_POST["_$prop"] : $default;
 
+      if ($prop == 'enable_installer')
+        $value = false;
+
       // convert some form data
       if ($prop == 'debug_level' && !$is_default) {
         if (is_array($value)) {
@@ -211,7 +216,7 @@
       }
 
       // skip this property
-      if (!array_key_exists($prop, $this->defaults) || ($value == $this->defaults[$prop])) {
+      if ((!array_key_exists($prop, $this->defaults) || ($value == $this->defaults[$prop])) && !in_array($prop, $this->local_config)) {
         continue;
       }
 

--
Gitblit v1.9.1