Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: mst3kroqs on August 29, 2009, 06:53:48 PM

Title: How to use logout_after hook?
Post by: mst3kroqs 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 ...
Title: How to use logout_after hook?
Post by: corbosman on August 30, 2009, 04:20:30 AM
logout_after was added after RC1. You need to use SVN.
Title: How to use logout_after hook?
Post by: mst3kroqs 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?