Benjamin Meichsner wrote:
hey,
I am using the plugin "automatic_addressbook" (vers. 0.1, RC vers. 0.3.1) and everything works fine, except the possibilty for the users to override the default configuration.
I solved the problem, as I manually merged the users preferences with the fresh loaded plugin configuration. Like this:
#automatic_addressbook.php: ... $this->load_config('config/config.inc.php.dist');
I think it is useless to load .dist config.
if(file_exists("./plugins/automatic_addressbook/config/config.inc.php")) $this->load_config('config/config.inc.php');
In svn-trunk version file existing check is not needed, load_config() will not generate a warning if file doesn't exists.
$rcmail = rcmail::get_instance();
$config = $rcmail->config; $config->merge($rcmail->user->get_prefs());
And this is not needed. See load_config(), it uses rcube_config::load_from_file() with 2nd argument set to false, so user preferences will be not overwritten.