summaryrefslogtreecommitdiff
path: root/program/include/rcube_config.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-02-18 18:01:53 +0000
committerthomascube <thomas@roundcube.net>2010-02-18 18:01:53 +0000
commitb545d3e8388d18a64d50b6f7879804cf4e7812ca (patch)
tree2f77722307e65126464f77de9cd6e8ec5ed7dbad /program/include/rcube_config.php
parent030db5b6c0489158b5a4cf1ab6d2542db0519de8 (diff)
Fix loading of plugin configs: user prefs will always survive (#1486368)
Diffstat (limited to 'program/include/rcube_config.php')
-rw-r--r--program/include/rcube_config.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php
index 85ff714bf..1e2aae33a 100644
--- a/program/include/rcube_config.php
+++ b/program/include/rcube_config.php
@@ -28,6 +28,7 @@ class rcube_config
{
private $prop = array();
private $errors = array();
+ private $userprefs = array();
/**
@@ -132,12 +133,12 @@ class rcube_config
* @param string Full path to the config file to be loaded
* @return booelan True on success, false on failure
*/
- public function load_from_file($fpath, $merge = true)
+ public function load_from_file($fpath)
{
if (is_file($fpath) && is_readable($fpath)) {
include($fpath);
if (is_array($rcmail_config)) {
- $this->prop = $merge ? array_merge($this->prop, $rcmail_config) : $this->prop + $rcmail_config;
+ $this->prop = array_merge($this->prop, $rcmail_config, $this->userprefs);
return true;
}
}
@@ -178,6 +179,19 @@ class rcube_config
*/
public function merge($prefs)
{
+ $this->prop = array_merge($this->prop, $prefs, $this->userprefs);
+ }
+
+
+ /**
+ * Merge the given prefs over the current config
+ * and make sure that they survive further merging.
+ *
+ * @param array Hash array with user prefs
+ */
+ public function set_user_prefs($prefs)
+ {
+ $this->userprefs = $prefs;
$this->prop = array_merge($this->prop, $prefs);
}