Roundcube Community Forum

 

Redirect to my login page on session timeout

Started by kuldeep, July 10, 2009, 02:19:19 AM

Previous topic - Next topic

kuldeep

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.

rosali

Why don't you just edit ./skins/default/templates/login.html ?

Add a meta tag to redirect ...
Regards,
Rosali

kuldeep

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!

kuldeep

No worries, i've achieved what i needed, but, i'll still like to know some ways to achieve this!

rosali

#4
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.
Regards,
Rosali

kuldeep

k, Thanks for the replies, i'll take that way into consideration!