| | |
| | | ob_end_clean(); |
| | | |
| | | if (is_array($rcmail_config)) { |
| | | $this->prop = array_merge($this->prop, $rcmail_config, $this->userprefs); |
| | | $this->merge($rcmail_config); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (isset($this->prop[$name])) { |
| | | $result = $this->prop[$name]; |
| | | } |
| | | else if (isset($this->legacy_props[$name])) { |
| | | return $this->get($this->legacy_props[$name], $def); |
| | | } |
| | | else { |
| | | $result = $def; |
| | |
| | | public function merge($prefs) |
| | | { |
| | | $this->prop = array_merge($this->prop, $prefs, $this->userprefs); |
| | | $this->fix_legacy_props(); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | $this->userprefs = $prefs; |
| | | $this->prop = array_merge($this->prop, $prefs); |
| | | |
| | | $this->fix_legacy_props(); |
| | | |
| | | // override timezone settings with client values |
| | | if ($this->prop['timezone'] == 'auto') { |
| | |
| | | return date_default_timezone_get(); |
| | | } |
| | | |
| | | /** |
| | | * Convert legacy options into new ones |
| | | */ |
| | | private function fix_legacy_props() |
| | | { |
| | | foreach ($this->legacy_props as $new => $old) { |
| | | if (isset($this->prop[$old])) { |
| | | if (!isset($this->prop[$new])) { |
| | | $this->prop[$new] = $this->prop[$old]; |
| | | } |
| | | unset($this->prop[$old]); |
| | | } |
| | | } |
| | | } |
| | | } |