Author Topic: Logout Redirection  (Read 6755 times)

Offline Gumtee

  • Newbie
  • *
  • Posts: 2
Logout Redirection
« on: August 13, 2006, 06:32:35 AM »
Hi,

Is there a way to redirect logging out to a html page e.g. to a custom you-are-now-logged-out.html instead of back to the default login page?

Thanks. :)



Offline flash

  • Jr. Member
  • **
  • Posts: 49
Re: Logout Redirection
« Reply #1 on: August 13, 2006, 12:41:11 PM »
I bet you could trap it in the index.php file based on the query string

?_task=mail&_action=logout

then do a
header('location: your_page.html'); die();

but you would have to do it after the actual logout process.

I will poke around some, that does sound like a neat idea.

Offline flash

  • Jr. Member
  • **
  • Posts: 49
Very easy
« Reply #2 on: August 13, 2006, 12:47:38 PM »
Just add this line:

 header('location: http://google.com'); die();

change google to your page

add it in this section of index.php

// end session
else if ($_action=='logout' && isset($_SESSION['user_id']))
 {
 show_message('loggedout');
 rcmail_kill_session();
 header('location: http://google.com'); die();
 }

Offline Gumtee

  • Newbie
  • *
  • Posts: 2
Re: Logout Redirection
« Reply #3 on: August 14, 2006, 01:41:43 AM »
Aha! Thanks for your time Flash, it works beautifully. Hope this helps some others too. :D

Offline flash

  • Jr. Member
  • **
  • Posts: 49
Re: Logout Redirection
« Reply #4 on: August 14, 2006, 11:54:02 AM »
I could see how this may be desired by many people in different situations. It would be easy to make this part of the config. Just set a config array variable with the "logout url" in the config file - or leave the variable blank. Then in the code do a simple if test. If the value is there, execute the line. If the variable has no value, back to the login page. A very easy two line mod (one to each file - config and index) to make this a config option.

I would suggest that mod, but I don't know how to do that around here. There should be a place to submit proposed code in the forum.

Offline xoqez

  • Jr. Member
  • **
  • Posts: 84
Re: Logout Redirection
« Reply #5 on: August 19, 2006, 05:35:24 AM »
Post it under Roundcube Webmail Forum > Latest Release [ 0.1 Beta 2 ] > Requests

--
Venond; using roundcube since June 2006
www.venond.com

Offline dracula

  • Newbie
  • *
  • Posts: 6
Re: Logout Redirection
« Reply #6 on: August 23, 2006, 03:14:03 PM »