[RCD] The identities_list hook

A.L.E.C alec at alec.pl
Fri Jun 7 14:26:45 CEST 2013

On 06/07/2013 02:01 PM, Philipp Kewisch wrote:
> Indeed, replacing the whole rcube_user class with my own implementation
> is ideal, I haven't gone this route because there is some code that
> assumes rcube_user is the only class to handle users and this sounds
> more invasive to me.

Just make your class to inherit from rcube_user, no?

> I initially tried to just call set_user() from the init function of the
> plugin, but this is already too late. Also I found out there are a few
> static functions that are called on rcube_user which need to be called
> on my class.

It's query() and create(). Query() shoudn't be a problem. In create(),
after user record creation, identities are created, but you can use
identity_create hook with abort=true to handle identity creation and
skip default action.

A good place to replace user object is the 'ready' hook.

Aleksander 'A.L.E.C' Machniak
LAN Management System Developer [http://lms.org.pl]
Roundcube Webmail Developer  [http://roundcube.net]
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl

More information about the dev mailing list