Author Topic: Redirect to my login page on session timeout  (Read 3763 times)

Offline kuldeep

  • Newbie
  • *
  • Posts: 5
Redirect to my login page on session timeout
« on: July 10, 2009, 02:19:19 AM »
Hi,

I've integrated roundcubemail in my applicaion, but, i need a little change in it, currently, as soon as the session expires, it logs out and redirects to roundcube default login page, but, i want it to redirect to my login page and i am unable to figure this out.

Plz suggest me a possible way to achieve this,
Thanks in advance,
Kul.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Redirect to my login page on session timeout
« Reply #1 on: July 10, 2009, 03:37:13 AM »
Why don't you just edit ./skins/default/templates/login.html ?

Add a meta tag to redirect ...
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline kuldeep

  • Newbie
  • *
  • Posts: 5
Redirect to my login page on session timeout
« Reply #2 on: July 10, 2009, 03:59:23 AM »
Well, i did exactly that, but, my application doesn't allow me to do this, because in some cases i need roundcube's login page too.

So, i just need to find a way to specify redirect url on session timeout!

Offline kuldeep

  • Newbie
  • *
  • Posts: 5
Redirect to my login page on session timeout
« Reply #3 on: July 10, 2009, 04:02:55 AM »
No worries, i've achieved what i needed, but, i'll still like to know some ways to achieve this!

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Redirect to my login page on session timeout
« Reply #4 on: July 10, 2009, 04:14:56 AM »
Can you append f.e. "&_rclogin=1" to the url when you need RoundCube login?

If so, it's easy to modify index.php to detect if it sends you to default login page or anywhere else:

find:

  $OUTPUT
->set_env('task''login');
  
$OUTPUT->send('login');


edit:

  
if(isset($_GET['_rclogin'])){
    
$OUTPUT->set_env('task''login');
    
$OUTPUT->send('login');
  }
  else{
    
header('Location: http://whereever.com');
   
// or
   // send it to a template
   // $OUTPUT->set_env('task', 'login');
   // $OUTPUT->send('mytemplate'); // ./skins/default/templates/mytemplate.html

  
}


In RoundCube v0.3 it will be easy to implement a plugin to embed RoundCube into other applications by using the 'render_page' hook.
« Last Edit: July 10, 2009, 05:18:00 AM by rosali »
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline kuldeep

  • Newbie
  • *
  • Posts: 5
Redirect to my login page on session timeout
« Reply #5 on: July 10, 2009, 05:08:17 AM »
k, Thanks for the replies, i'll take that way into consideration!