Changeset 0829b76 in github


Ignore:
Timestamp:
Nov 26, 2011 9:31:50 AM (18 months ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
Children:
2cf55f4
Parents:
3e5c709
Message:
  • Fix merging some configuration options in update.sh script (#1485864)
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r3e5c709 r0829b76  
    22=========================== 
    33 
     4- Fix merging some configuration options in update.sh script (#1485864) 
    45- Fix so TEXT key will remove all HEADER keys in IMAP SEARCH (#1488208) 
    56- Fix handling contact photo url with https:// prefix (#1488202) 
  • config/main.inc.php.dist

    rce22f1e r0829b76  
    658658$rcmail_config['timezone'] = 'auto'; 
    659659 
    660 // is daylight saving On? 
    661 $rcmail_config['dst_active'] = (bool)date('I'); 
     660// is daylight saving On? Default: (bool)date('I'); 
     661$rcmail_config['dst_active'] = null; 
    662662 
    663663// prefer displaying HTML messages 
  • installer/rcube_install.php

    r4348692 r0829b76  
    143143    foreach ($this->config as $prop => $default) { 
    144144 
    145       $value = (isset($_POST["_$prop"]) || $this->bool_config_props[$prop]) ? $_POST["_$prop"] : $default; 
     145      $is_default = !isset($_POST["_$prop"]); 
     146      $value      = !$is_default || $this->bool_config_props[$prop] ? $_POST["_$prop"] : $default; 
    146147 
    147148      // convert some form data 
    148       if ($prop == 'debug_level') { 
    149         $val = 0; 
    150         if (is_array($value)) 
     149      if ($prop == 'debug_level' && !$is_default) { 
     150        if (is_array($value)) { 
     151          $val = 0; 
    151152          foreach ($value as $dbgval) 
    152153            $val += intval($dbgval); 
    153         $value = $val; 
     154          $value = $val; 
     155        } 
    154156      } 
    155157      else if ($which == 'db' && $prop == 'db_dsnw' && !empty($_POST['_dbtype'])) { 
    156158        if ($_POST['_dbtype'] == 'sqlite') 
    157159          $value = sprintf('%s://%s?mode=0646', $_POST['_dbtype'], $_POST['_dbname']{0} == '/' ? '/' . $_POST['_dbname'] : $_POST['_dbname']); 
    158         else 
     160        else if ($_POST['_dbtype']) 
    159161          $value = sprintf('%s://%s:%s@%s/%s', $_POST['_dbtype'],  
    160162            rawurlencode($_POST['_dbuser']), rawurlencode($_POST['_dbpass']), $_POST['_dbhost'], $_POST['_dbname']); 
     
    178180      } 
    179181      else if ($prop == 'default_imap_folders') { 
    180             $value = Array(); 
     182            $value = array(); 
    181183            foreach ($this->config['default_imap_folders'] as $_folder) { 
    182               switch($_folder) { 
     184              switch ($_folder) { 
    183185              case 'Drafts': $_folder = $this->config['drafts_mbox']; break; 
    184186              case 'Sent':   $_folder = $this->config['sent_mbox']; break; 
     
    207209      $out = preg_replace( 
    208210        '/(\$rcmail_config\[\''.preg_quote($prop).'\'\])\s+=\s+(.+);/Uie', 
    209         "'\\1 = ' . rcube_install::_dump_var(\$value) . ';'", 
     211        "'\\1 = ' . rcube_install::_dump_var(\$value, \$prop) . ';'", 
    210212        $out); 
    211213    } 
     
    300302    $this->config = array(); 
    301303    $this->load_defaults(); 
    302      
     304 
    303305    foreach ($this->replaced_config as $prop => $replacement) { 
    304306      if (isset($current[$prop])) { 
     
    329331    if ($current['keep_alive'] && $current['session_lifetime'] < $current['keep_alive']) 
    330332      $current['session_lifetime'] = max(10, ceil($current['keep_alive'] / 60) * 2); 
    331      
     333 
    332334    $this->config  = array_merge($this->config, $current); 
    333      
     335 
    334336    foreach ((array)$current['ldap_public'] as $key => $values) { 
    335337      $this->config['ldap_public'][$key] = $current['ldap_public'][$key]; 
     
    615617   
    616618   
    617   static function _dump_var($var) { 
     619  static function _dump_var($var, $name=null) { 
     620    // special values 
     621    switch ($name) { 
     622    case 'syslog_facility': 
     623      $list = array(32 => 'LOG_AUTH', 80 => 'LOG_AUTHPRIV', 72 => ' LOG_CRON', 
     624                    24 => 'LOG_DAEMON', 0 => 'LOG_KERN', 128 => 'LOG_LOCAL0', 
     625                    136 => 'LOG_LOCAL1', 144 => 'LOG_LOCAL2', 152 => 'LOG_LOCAL3', 
     626                    160 => 'LOG_LOCAL4', 168 => 'LOG_LOCAL5', 176 => 'LOG_LOCAL6', 
     627                    184 => 'LOG_LOCAL7', 48 => 'LOG_LPR', 16 => 'LOG_MAIL', 
     628                    56 => 'LOG_NEWS', 40 => 'LOG_SYSLOG', 8 => 'LOG_USER', 64 => 'LOG_UUCP'); 
     629      if ($val = $list[$var]) 
     630        return $val; 
     631      break; 
     632    } 
     633 
     634 
    618635    if (is_array($var)) { 
    619636      if (empty($var)) { 
  • program/include/rcube_config.php

    rf4f4354f r0829b76  
    9191        // enable display_errors in 'show' level, but not for ajax requests 
    9292        ini_set('display_errors', intval(empty($_REQUEST['_remote']) && ($this->prop['debug_level'] & 4))); 
    93          
     93 
    9494        // set timezone auto settings values 
    9595        if ($this->prop['timezone'] == 'auto') { 
    9696          $this->prop['dst_active'] = intval(date('I')); 
    97           $this->prop['_timezone_value']   = date('Z') / 3600 - $this->prop['dst_active']; 
     97          $this->prop['_timezone_value'] = date('Z') / 3600 - $this->prop['dst_active']; 
     98        } 
     99        else if ($this->prop['dst_active'] === null) { 
     100          $this->prop['dst_active'] = intval(date('I')); 
    98101        } 
    99102 
Note: See TracChangeset for help on using the changeset viewer.