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');
if(file_exists("./plugins/automatic_addressbook/config/config.inc.php")) $this->load_config('config/config.inc.php'); $rcmail = rcmail::get_instance(); $config = $rcmail->config; $config->merge($rcmail->user->get_prefs());
Now I am just interested if this is the prefered solution. I mean, why is it necessary to manually merge the user's config with the plugin defaults. Shoudn't it be done automatically?
benni
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/4G/8sx3mIk1/signature.asc Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
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.
On Wed, Feb 10, 2010 at 18:56, A.L.E.C alec@alec.pl wrote:
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.
This should now be definitely fixed in http://trac.roundcube.net/changeset/3274
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/