Author Topic: How to use logout_after hook?  (Read 6638 times)

Offline mst3kroqs

  • Newbie
  • *
  • Posts: 3
How to use logout_after hook?
« on: August 29, 2009, 06:53:48 PM »
Greetings -

Using 0.3RC1, BTW.  logout_after plugin API docs say:

Quote
After the user is logged out and the session is killed, this hook is triggered.
The arguments still contain some user info which is not available in $_SESSION anymore. It's also possible to redirect to some other URL in this hook because it's the last action in the logout process.

Arguments:

    * host
    * user
    * language

Return values:

    none.


Great, would really like to do that whole URL redirect thing, but how?  Here are the relevant sections of my plugin code:

class myplugin extends rcube_plugin
{

  function 
init()
  {
    
$this->add_hook('logout_after', array($this'logout_after'));
  }

  function 
logout_after($args)
  {
    
header"Location: http://www.someurl.com" );
    return 
$args;
  }
}


Clicking 'Logout' results in 'standard' behavior, eg. no redirect ...
« Last Edit: August 29, 2009, 06:59:36 PM by mst3kroqs »

Offline corbosman

  • Sr. Member
  • ****
  • Posts: 260
How to use logout_after hook?
« Reply #1 on: August 30, 2009, 04:20:30 AM »
logout_after was added after RC1. You need to use SVN.

Offline mst3kroqs

  • Newbie
  • *
  • Posts: 3
How to use logout_after hook?
« Reply #2 on: August 30, 2009, 01:28:58 PM »
Quote from: corbosman;20852
logout_after was added after RC1. You need to use SVN.


Aha!  Thanks - any database changes or can I overwrite my 0.3RC1 installation with the contents of the SVN?