From 0c3bde206460bfd710b9b0e406c146e87192a9ff Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 05 Sep 2008 06:19:01 -0400
Subject: [PATCH] #1485313: fixed DB config updating

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

diff --git a/installer/rcube_install.php b/installer/rcube_install.php
index e338253..0c4544f 100644
--- a/installer/rcube_install.php
+++ b/installer/rcube_install.php
@@ -122,7 +122,7 @@
     
     if (!$out)
       return '[Warning: could not read the template file]';
-    
+
     foreach ($this->config as $prop => $default) {
       $value = (isset($_POST["_$prop"]) || $this->config_props[$prop]) ? $_POST["_$prop"] : $default;
       
@@ -134,7 +134,7 @@
             $val += intval($dbgval);
 	$value = $val;
       }
-      else if ($prop == 'db_dsnw' && !empty($_POST['_dbtype'])) {
+      else if ($which == 'db' && $prop == 'db_dsnw' && !empty($_POST['_dbtype'])) {
         if ($_POST['_dbtype'] == 'sqlite')
           $value = sprintf('%s://%s?mode=0646', $_POST['_dbtype'], $_POST['_dbname']{0} == '/' ? '/' . $_POST['_dbname'] : $_POST['_dbname']);
         else
@@ -179,7 +179,7 @@
         "'\\1 = ' . var_export(\$value, true) . ';'",
         $out);
     }
-    
+
     return trim($out);
   }
   

--
Gitblit v1.9.1