Wednesday, July 3, 2013

Roundcube Mail: How to redirect to an URL after logout

Open roundcubemail/index.php file and edit following code:

else if ($RCMAIL->task == 'logout' && isset($_SESSION['user_id']) && (!$RCMAIL->config->get('referer_check') || rcmail::check_referer())) {
  $userdata = array(
    'user' => $_SESSION['username'],
    'host' => $_SESSION['storage_host'],
    'lang' => $RCMAIL->user->language,
  );
  $OUTPUT->show_message('loggedout');
  header('location: https://redirect URL/'); die();
//  $RCMAIL->logout_actions();
//  $RCMAIL->kill_session();
//  $RCMAIL->plugins->exec_h

3 comments:

  1. please how do i get to the php file you talk about? Thank you

    ReplyDelete
    Replies
    1. Go to your roundcube mail folder then you will see a index.php file

      Delete
  2. It works a lot better if like this, this way the users session is actually ended truly logging them out. Good tip though.

    $OUTPUT->show_message('loggedout');

    $RCMAIL->logout_actions();
    $RCMAIL->kill_session();
    header('location: https://redirect URL/'); die();
    // $RCMAIL->plugins->exec_h

    ReplyDelete