public function merge_config()
    {
        $current      = $this->config;
        $this->config = array();

        foreach ($this->replaced_config as $prop => $replacement) {
            if (isset($current[$prop])) {
                if ($prop == 'skin_path') {
                    $this->config[$replacement] = preg_replace('#skins/(\w+)/?$#', '\\1', $current[$prop]);
                }
                else if ($prop == 'multiple_identities') {
                    $this->config[$replacement] = $current[$prop] ? 2 : 0;
                }
                else {
                    $this->config[$replacement] = $current[$prop];
                }
            }

            unset($current[$prop]);
        }

        foreach ($this->obsolete_config as $prop) {
            unset($current[$prop]);
        }

        // add all ldap_public sources having global_search enabled to autocomplete_addressbooks
        if (is_array($current['ldap_public'])) {
            foreach ($current['ldap_public'] as $key => $ldap_public) {
                if ($ldap_public['global_search']) {
                    $this->config['autocomplete_addressbooks'][] = $key;
                    unset($current['ldap_public'][$key]['global_search']);
                }
            }
        }

        $this->config = array_merge($this->config, $current);

        foreach (array_keys((array) $current['ldap_public']) as $key) {
            $this->config['ldap_public'][$key] = $current['ldap_public'][$key];
        }
    }