Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: neo_fk on June 04, 2014, 07:23:21 AM

Title: How to implement login_after (within plugin hooks)
Post by: neo_fk on June 04, 2014, 07:23:21 AM
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
Title: Re: How to implement login_after (within plugin hooks)
Post by: JohnDoh on June 05, 2014, 02:45:47 AM
there is some information here about how to write a plugin http://trac.roundcube.net/wiki/Doc_Plugins
Title: Re: How to implement login_after (within plugin hooks)
Post by: neo_fk on July 03, 2014, 09:01:03 AM
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.
Title: Re: How to implement login_after (within plugin hooks)
Post by: neo_fk on July 03, 2014, 09:16:20 AM
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']);

Title: Re: How to implement login_after (within plugin hooks)
Post by: SKaero on July 08, 2014, 12:23:11 PM
You just need to code your own plugin, take a look at some of the plugins that come with Roundcube to understand it better.
Title: Re: How to implement login_after (within plugin hooks)
Post by: neo_fk on July 18, 2014, 08:25:22 AM
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.
Title: Re: How to implement login_after (within plugin hooks)
Post by: JohnDoh on July 18, 2014, 08:58:15 AM
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.
Title: Re: How to implement login_after (within plugin hooks)
Post by: neo_fk on July 18, 2014, 11:05:14 AM
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 ?