yllar
2008-05-30 186f3fa81f232344742b0a1c6313ec0744cbd651
installer/rcube_install.php
@@ -79,7 +79,7 @@
   */
  function _load_config($suffix)
  {
    include '../config/main.inc' . $suffix;
    @include '../config/main.inc' . $suffix;
    if (is_array($rcmail_config)) {
      $this->config += $rcmail_config;
    }
@@ -102,8 +102,8 @@
  {
    $value = $this->is_post && (isset($_POST["_$name"]) || $this->config_props[$name]) ? $_POST["_$name"] : $this->config[$name];
    
    if ($name == 'des_key' && !isset($_REQUEST["_$name"]))
      $value = self::random_key(24);
    if ($name == 'des_key' && !$this->configured && !isset($_REQUEST["_$name"]))
      $value = rcube_install::random_key(24);
    
    return $value !== null && $value !== '' ? $value : $default;
  }
@@ -137,15 +137,20 @@
        if ($_POST['_dbtype'] == 'sqlite')
          $value = sprintf('%s://%s?mode=0646', $_POST['_dbtype'], $_POST['_dbname']{0} == '/' ? '/' . $_POST['_dbname'] : $_POST['_dbname']);
        else
          $value = sprintf('%s://%s:%s@%s/%s', $_POST['_dbtype'], $_POST['_dbuser'], $_POST['_dbpass'], $_POST['_dbhost'], $_POST['_dbname']);
          $value = sprintf('%s://%s:%s@%s/%s', $_POST['_dbtype'],
          rawurlencode($_POST['_dbuser']), rawurlencode($_POST['_dbpass']),
          $_POST['_dbhost'], $_POST['_dbname']);
      }
      else if ($prop == 'smtp_auth_type' && $value == '0') {
        $value = '';
      }
      else if ($prop == 'default_host' && is_array($value)) {
        $value = self::_clean_array($value);
        $value = rcube_install::_clean_array($value);
        if (count($value) <= 1)
          $value = $value[0];
      }
      else if ($prop == 'pagesize') {
        $value = max(2, intval($value));
      }
      else if ($prop == 'smtp_user' && !empty($_POST['_smtp_user_u'])) {
        $value = '%u';
@@ -171,7 +176,7 @@
        $out);
    }
    
    return $out;
    return trim($out);
  }
  
  
@@ -305,6 +310,8 @@
        if (eregi(';$', trim($line))) {
          $DB->query($buff);
          $buff = '';
          if ($this->get_error())
            break;
        }
      }
    }