Roundcube Community Forum

 

How to implement login_after (within plugin hooks)

Started by neo_fk, June 04, 2014, 07:23:21 AM

Previous topic - Next topic

neo_fk

Hi,

I am interested in using login_after within the plugin Hooks.
However, I would like to know how to implement it from PHP script. Do I need to install anything ?

Best regards,

Neo_fk

JohnDoh

Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

neo_fk

I have seen this link but I am quite lost.
I use RoundCube v0.9.5 included into Plesk and I have no idea on how to install hook plugins.
I am just interested in the login_after, to manage an automatic authentication while sending an email via a php script.

I need help if someone has already implemented it.

neo_fk

I also read this link http://trac.roundcube.net/wiki/Plugin_Hooks but in vain.
I do not understand if I need to download something, add it into plugins directory...
or nothing exist at all and I need to write my own plugin ?

because there are some lines about login_after within index.php file of roundcube on line 143 :

<?php
/*
+-------------------------------------------------------------------------+
| Roundcube Webmail IMAP Client                                           |
| Version 0.9.5                                                           |
|                                                                         |
| Copyright (C) 2005-2013, The Roundcube Dev Team                         |
|                                                                         |
| This program is free software: you can redistribute it and/or modify    |
| it under the terms of the GNU General Public License (with exceptions   |
| for skins & plugins) as published by the Free Software Foundation,      |
| either version 3 of the License, or (at your option) any later version. |
|                                                                         |
| This file forms part of the Roundcube Webmail Software for which the    |
| following exception is added: Plugins and Skins which merely make       |
| function calls to the Roundcube Webmail Software, and for that purpose  |
| include it by reference shall not be considered modifications of        |
| the software.                                                           |
|                                                                         |
| If you wish to use this file in another project or create a modified    |
| version that will not be part of the Roundcube Webmail Software, you    |
| may remove the exception above and use this source code under the       |
| original version of the license.                                        |
|                                                                         |
| This program is distributed in the hope that it will be useful,         |
| but WITHOUT ANY WARRANTY; without even the implied warranty of          |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            |
| GNU General Public License for more details.                            |
|                                                                         |
| You should have received a copy of the GNU General Public License       |
| along with this program.  If not, see http://www.gnu.org/licenses/.     |
|                                                                         |
+-------------------------------------------------------------------------+
| Author: Thomas Bruederli <[email protected]>                          |
+-------------------------------------------------------------------------+
*/

......

142   // allow plugins to control the redirect url after login success
143   $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail'));
144   unset($redir['abort'], $redir['_err']);


SKaero

You just need to code your own plugin, take a look at some of the plugins that come with Roundcube to understand it better.

neo_fk

yep....

I love your "just" SKaero, knowing I have never done it before. ;-)

Has anybody already develop its own login_after pluging ? because it could really help me to begin.

JohnDoh

there is the http_authentication plugin that is shipped with roundcube. it does some other things too but you should be able to see how it attaches to the login_after hook.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

neo_fk

Thanks for help... but I have found a solution avoiding to develop my own login_after plugin.
Is there anything to do to close the subject ?