Author Topic: How to implement login_after (within plugin hooks)  (Read 5984 times)

Offline neo_fk

  • Newbie
  • *
  • Posts: 5
How to implement login_after (within plugin hooks)
« 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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Re: How to implement login_after (within plugin hooks)
« Reply #1 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
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline neo_fk

  • Newbie
  • *
  • Posts: 5
Re: How to implement login_after (within plugin hooks)
« Reply #2 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.

Offline neo_fk

  • Newbie
  • *
  • Posts: 5
Re: How to implement login_after (within plugin hooks)
« Reply #3 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 <roundcube@gmail.com>                          |
 +-------------------------------------------------------------------------+
*/

......

 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']);


Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: How to implement login_after (within plugin hooks)
« Reply #4 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.

Offline neo_fk

  • Newbie
  • *
  • Posts: 5
Re: How to implement login_after (within plugin hooks)
« Reply #5 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.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Re: How to implement login_after (within plugin hooks)
« Reply #6 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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline neo_fk

  • Newbie
  • *
  • Posts: 5
Re: How to implement login_after (within plugin hooks)
« Reply #7 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 ?