Opened 3 years ago
Closed 3 years ago
#1486894 closed Bugs (fixed)
Issues with plugin-hooks in version 0.4 Beta
| Reported by: | mrbond | Owned by: | |
|---|---|---|---|
| Priority: | 10 - Lowest | Milestone: | 0.4-stable |
| Component: | Plugins | Version: | 0.4-beta |
| Severity: | trivial | Keywords: | pluginhook createuser |
| Cc: |
Description
Hi,
I'm currently trying to use the squirrelmail_usercopy plugin in RoundCube 0.4Beta, and when this didn't work as expected I started debugging.
I ended up with this test-case:
class squirrelmail_usercopy extends rcube_plugin
{
//public $task = 'login|settings';
public function init()
{
$rcmail = rcmail::get_instance();
write_log('errors', 'squirrelmail_usercopy init()');
$this->add_hook('identity_create', array($this, 'create_identity'));
$this->add_hook('identity_create', array($this, 'create_user'));
$this->add_hook('login_failed', array($this, 'auth_failed'));
}
public function auth_failed($p)
{
write_log('errors', 'login failed! from auth-failed()');
}
private function create_identity($p)
{
write_log('errors', 'usercopy create_identity()');
return $p;
}
private function create_user($p)
{
write_log('errors', 'usercopy create_user()');
return $p;
}
}
My configuration has enabled 'auto_create_user'.
What I do is I clear out all the mysql-tables (including sessions), and then try to login, to trigger 'create_user' and 'create_identity', but these hooks are just not beeing called. The 'auth_failed'-hook is however, leading me to believe this is a issue in roundcube.
Here is what the log outputs (login failed is just to demontstrate the auth_failed hook):
[04-Aug-2010 13:16:57 +0200]: squirrelmail_usercopy init() [04-Aug-2010 13:16:57 +0200]: squirrelmail_usercopy init() [04-Aug-2010 13:17:01 +0200]: squirrelmail_usercopy init() [04-Aug-2010 13:17:04 +0200]: squirrelmail_usercopy init() [04-Aug-2010 13:17:09 +0200]: IMAP Error: Authentication for a failed (LOGIN): "a001 NO LOGIN failed" in /usr/local/www/roundcubemail-0.4-beta/program/include/rcube_imap.php on line 141 (POST /?_task=&_action=login) [04-Aug-2010 13:17:09 +0200]: login failed! from auth-failed()
My environment:
PHP 5.3.3 with Suhosin-Patch (via lighttpd-1.4.26 and FastCGI)
I installed all the required and recommended modules/settings mentioned in the RoundCube-installer.
Cheers, RoundCube seems like excellent software, and I'm sure issues like this one will be ironed out before release
Change History (3)
comment:1 Changed 3 years ago by mrbond
- Priority changed from 5 to 10 - Lowest
- Severity changed from major to trivial
comment:2 Changed 3 years ago by mrbond
However I found a problem in the squirrelmail_usercopy code:
This:
if (!$ilevel === null)
$ilevel = $rcmail->config->get('identities_level', 0);
Should be:
if ($ilevel === null)
$ilevel = $rcmail->config->get('identities_level', 0);
Cheers!
comment:3 Changed 3 years ago by alec
- Component changed from Addressbook to Plugins
- Milestone changed from later to 0.4-stable
- Resolution set to fixed
- Status changed from new to closed
Fixed in r3867/svn.

My bad, I took the skeleton from the newer squirrelmail_usercopy in trunk, because I needed SQL-support. Turns out the plugin-hooks where renamed from 'identity_create' to 'create_identity' (Thanks JohnDoe?!), this ticket can be closed.