Roundcube Community Forum

 

RC 0.3.1 - Squirrelmail_usercopy v1.1 not working

Started by Professa Dementia, March 13, 2010, 07:38:09 AM

Previous topic - Next topic

Professa Dementia

I have a vanilla install of RC 0.3.1.  I installed the squirrelmail_usercopy pluging from this site - version 1.1.  The 0.3.1 distro has version 1.0, but a diff of the two shows minimal differences.  I also enabled the calendar plugin.

When I login, the system fails to copy the squirrelmail data to the new user, instead creating the default setup for the new user.

To debug, I modified program/include/rcube_plugin_api.php to log details as it is instantiating and calling the plugins (the bottom of this post has the changes).

When I log in with a new user, the logs show that the mail task gets triggered repeatedly.  The logout task gets triggered when I log out, however, not once does the login task get triggered.  Consequently, the Squirrelmail plugin never gets run.

I also tested the new_user_dialog plugin.  The tasks it registers with are login and mail.  It works only because it triggers on the mail task since the login task never triggers.

Is this a know problem?  I could not find anything about this in the bug reporting area.

Thank you.




Code mods to rcube_plugin_api.php for debug logging:

    foreach ($plugins_enabled as $plugin_name) {
write_log('console', "\n\n========\nPlugin: " . $plugin_name);
      $fn = $plugins_dir->path . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';

write_log('console', "Plugin main prog: " . $fn);
      if (file_exists($fn)) {
write_log('console', "Plugin exists");
        include($fn);

        // instantiate class if exists
        if (class_exists($plugin_name, false)) {
          $plugin = new $plugin_name($this);
write_log('console', "Plugin class instantiated");
          // check inheritance and task specification
write_log('console', "\$rcmail->task = " . $rcmail->task . "   match regex = /(" . $plugin->task . ")/i");
          if (is_subclass_of($plugin, 'rcube_plugin') && (!$plugin->task || preg_match('/('.$plugin->task.')/i', $rcmail->task))) {
write_log('console', "Plugin class is rcube_plugin");
            $plugin->init();
write_log('console', "Plugin class after init");
            $this->plugins[] = $plugin;
          }
        }

alec

It's not working with 0.3.1, because of changes in plugin api.

Professa Dementia

Thanks for the reply.  There was no indication that the plugin on the plugins repository would not work on certain versions.

It would be good to follow what Firefox does and embed version numbers in the plugins that specify which version of RC the plugin will work with.  When RC starts and sees an incompatible plugin, it should make a log entry stating that it disabled that plugin, so the admin can track down the problems.

Thanks, again.