Changeset b545d3e in github


Ignore:
Timestamp:
Feb 18, 2010 1:01:53 PM (3 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
29640bcf
Parents:
030db5b
Message:

Fix loading of plugin configs: user prefs will always survive (#1486368)

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r1e6b19d rb545d3e  
    22=========================== 
    33 
     4- Fix merging of configuration parameters: user prefs always survive (#1486368)  
    45- Fix quota indicator value after folder purge/expunge (#1486488) 
    56- Fix external mailto links support for use as protocol handler (#1486037) 
  • program/include/rcmail.php

    r48bc52e rb545d3e  
    179179       
    180180      // overwrite config with user preferences 
    181       $this->config->merge((array)$this->user->get_prefs()); 
     181      $this->config->set_user_prefs((array)$this->user->get_prefs()); 
    182182    } 
    183183     
  • program/include/rcube_config.php

    r10eedbe rb545d3e  
    2929  private $prop = array(); 
    3030  private $errors = array(); 
     31  private $userprefs = array(); 
    3132 
    3233 
     
    133134   * @return booelan True on success, false on failure 
    134135   */ 
    135   public function load_from_file($fpath, $merge = true) 
     136  public function load_from_file($fpath) 
    136137  { 
    137138    if (is_file($fpath) && is_readable($fpath)) { 
    138139      include($fpath); 
    139140      if (is_array($rcmail_config)) { 
    140         $this->prop = $merge ? array_merge($this->prop, $rcmail_config) : $this->prop + $rcmail_config; 
     141        $this->prop = array_merge($this->prop, $rcmail_config, $this->userprefs); 
    141142        return true; 
    142143      } 
     
    179180  public function merge($prefs) 
    180181  { 
     182    $this->prop = array_merge($this->prop, $prefs, $this->userprefs); 
     183  } 
     184   
     185   
     186  /** 
     187   * Merge the given prefs over the current config 
     188   * and make sure that they survive further merging. 
     189   * 
     190   * @param array  Hash array with user prefs 
     191   */ 
     192  public function set_user_prefs($prefs) 
     193  { 
     194    $this->userprefs = $prefs; 
    181195    $this->prop = array_merge($this->prop, $prefs); 
    182196  } 
  • program/include/rcube_plugin.php

    r10eedbe rb545d3e  
    6060    $fpath = $this->home.'/'.$fname; 
    6161    $rcmail = rcmail::get_instance(); 
    62     if (is_file($fpath) && !$rcmail->config->load_from_file($fpath, false)) { 
     62    if (is_file($fpath) && !$rcmail->config->load_from_file($fpath)) { 
    6363      raise_error(array('code' => 527, 'type' => 'php', 
    6464        'file' => __FILE__, 'line' => __LINE__, 
  • program/include/rcube_user.php

    r638fb8a rb545d3e  
    124124    $this->language = $_SESSION['language']; 
    125125    if ($this->db->affected_rows()) { 
    126       $config->merge($a_user_prefs); 
     126      $config->set_user_prefs($a_user_prefs); 
    127127      return true; 
    128128    } 
Note: See TracChangeset for help on using the changeset viewer.