Fix regression when startup() method of some "by role plugins" could be called when not expected, causing PHP errors

This commit is contained in:
Aleksander Machniak 2017-10-03 10:13:10 +02:00
parent 915b86bb80
commit 1abc73cf34

View file

@ -331,8 +331,8 @@ class kolab_auth extends rcube_plugin
// Some plugins e.g. kolab_2fa use 'startup' hook to
// register other hooks, but when called on 'authenticate' hook
// we're already after 'startup', so we'll call it directly
if ($loaded && $startup && ($plugin = $this->api->get_plugin($plugin))
&& method_exists($plugin, 'startup')
if ($loaded && $startup && $plugin == 'kolab_2fa'
&& ($plugin = $this->api->get_plugin($plugin))
) {
$plugin->startup(array('task' => $rcmail->task, 'action' => $rcmail->action));
}