Author Topic: which plugin handle login_after hook?  (Read 4309 times)

Offline tungle

  • Newbie
  • *
  • Posts: 7
which plugin handle login_after hook?
« on: April 11, 2011, 11:12:42 AM »
Hi I'm new to RoundCube, walking thru the code to customize it.
It seems to me that there's no existing plugin that handles the 'login_after' hook.
Given the line 123 in the index.php file:

$redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail'));



and the system is working well, I must be missing something. Can anyone help?
Tks.
« Last Edit: April 12, 2011, 10:37:58 AM by tungle »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
which plugin handle login_after hook?
« Reply #1 on: April 11, 2011, 12:01:36 PM »
That is simply one of many hooks which plugins can use if they want. I'm sure there are plugins around which use it. Which ones use it in your setup depend on what plugins you have installed......
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline tungle

  • Newbie
  • *
  • Posts: 7
which plugin handle login_after hook?
« Reply #2 on: April 11, 2011, 09:48:22 PM »
Hi John, tks for replying.
In the standard download, I scanned through all the files in the plugins folder, but couldn't find any file with an explicit statement:
add_hook('login_after')
That's what puzzles me. Could u pls point out 1 for me?
(Since I'm following the workflow, but get stuck there).

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
which plugin handle login_after hook?
« Reply #3 on: April 12, 2011, 02:33:47 AM »
you are right, there are none distributed with the core which use it. but if you look here you'll find a few, for example remember_me and remember_skin which are part of the myroundcube package.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline tungle

  • Newbie
  • *
  • Posts: 7
which plugin handle login_after hook?
« Reply #4 on: April 12, 2011, 08:37:26 AM »
hi John,
Let me rephrase my question. What I want to know is which file (or plugin ) is called after the line 124 $OUTPUT->redirect($redir) is executed.

(Since I dont know which plugin that handled 'login_after' hook, can't find what the value of $redir is)
Could you pls help? tks.

Code: [Select]
   $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('_task' => 'mail'));
    unset($redir['abort']);

    // send redirect
    $OUTPUT->redirect($redir);

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
which plugin handle login_after hook?
« Reply #5 on: April 12, 2011, 09:06:42 AM »
If there's no plugin for this hook or plugin doesn't change anything then:
$redir = $query + array('_task' => 'mail');

Offline tungle

  • Newbie
  • *
  • Posts: 7
which plugin handle login_after hook?
« Reply #6 on: April 12, 2011, 09:09:36 AM »
tks alec for rep,
so what's the value of $redir then?
and what file is called after  $OUTPUT->redirect($redir) is executed?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
which plugin handle login_after hook?
« Reply #7 on: April 12, 2011, 09:42:20 AM »
you see a few lines above the execute_hook line, $query is populated with the information from the requesting url - if there is any. then _task=mail is put of coz its needed to actually get to the inbox and thats it. redirect to that URL, it will normally end up just being /?_task=mail
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline tungle

  • Newbie
  • *
  • Posts: 7
which plugin handle login_after hook?
« Reply #8 on: April 12, 2011, 10:38:32 AM »
tks JohnDoh