alecpl
2009-10-19 efe93ad11610fcfd42c76a1cdddb07be00f8cf1b
installer/rcube_install.php
@@ -136,10 +136,10 @@
   */
  function create_config($which, $force = false)
  {
    $out = file_get_contents(RCMAIL_CONFIG_DIR . "/{$which}.inc.php.dist");
    $out = @file_get_contents(RCMAIL_CONFIG_DIR . "/{$which}.inc.php.dist");
    
    if (!$out)
      return '[Warning: could not read the template file]';
      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;
@@ -175,6 +175,18 @@
      }
      else if ($prop == 'smtp_pass' && !empty($_POST['_smtp_user_u'])) {
        $value = '%p';
      }
      else if ($prop == 'default_imap_folders'){
   $value = Array();
   foreach($this->config['default_imap_folders'] as $_folder){
     switch($_folder) {
     case 'Drafts': $_folder = $this->config['drafts_mbox']; break;
     case 'Sent':   $_folder = $this->config['sent_mbox']; break;
     case 'Junk':   $_folder = $this->config['junk_mbox']; break;
     case 'Trash':  $_folder = $this->config['trash_mbox']; break;
          }
     if (!in_array($_folder, $value))  $value[] = $_folder;
        }
      }
      else if (is_bool($default)) {
        $value = (bool)$value;
@@ -455,6 +467,20 @@
    echo Q($name) . ':&nbsp; <span class="fail">NOT OK</span>';
    $this->_showhint($message, $url);
  }
  /**
   * Display an error status for optional settings/features
   *
   * @param string Test name
   * @param string Error message
   * @param string URL for details
   */
  function optfail($name, $message = '', $url = '')
  {
    echo Q($name) . ':&nbsp; <span class="na">NOT OK</span>';
    $this->_showhint($message, $url);
  }
  
  
  /**
@@ -539,11 +565,11 @@
    if ($lines = @file($fname, FILE_SKIP_EMPTY_LINES)) {
      $buff = '';
      foreach ($lines as $i => $line) {
        if (eregi('^--', $line))
        if (preg_match('/^--/', $line))
          continue;
          
        $buff .= $line . "\n";
        if (eregi(';$', trim($line))) {
        if (preg_match('/;$/', trim($line))) {
          $DB->query($buff);
          $buff = '';
          if ($this->get_error())