Roundcube Community Forum

Release Support => Pending Issues => Topic started by: Spaceman on January 24, 2012, 12:28:25 PM

Title: After Login, redirect to another page
Post by: Spaceman on January 24, 2012, 12:28:25 PM
Hello everybody! :)

I'm using roundcube 0.7.1 and I would like to redirect users to another page after the automatic login in RC is made.


I have a website which creates mail accounts to registered users. When those users login to my website, a php script is executed to log them in into my website first, and then it logs them in RC using the autologon plugin. This process ends with the RC main mail page opened.

How can I automatically redirect the users to another page (my website's homepage) after the RC login?


Thank you very much.

:)
Title: After Login, redirect to another page
Post by: SKaero on January 25, 2012, 12:37:53 AM
Try adding a redirect to your homepage using the login_after Plugin_Hooks (http://trac.roundcube.net/wiki/Plugin_Hooks#login_after) hook.
Title: After Login, redirect to another page
Post by: Spaceman on January 25, 2012, 05:28:15 AM
Thanks, skaero! It is now working. :)


For anyone interested, I edited the login_redirect.php like this:

<?PHP
class login_redirect extends rcube_plugin
{
  public $tasks = 'login';
//  private $mbox = 'IMAP.Roundcube.XYZ'; //here goes the mailbox to redirect to
  function init(){
    $this->add_hook('login_after', array($this, 'login_after'));
  }
  function login_after($args){
//    $rcmail = rcmail::get_instance();
//    $args['_task'] = 'mail';
//    $args['_action'] = '';
 header(&quot;Location: http://www.mywebsite.com/home.php&quot;);
 exit;
//    $args['_mbox'] = $this->mbox;
//    return $args;
  }
}
?>
Title: After Login, redirect to another page
Post by: Spaceman on January 25, 2012, 07:12:22 AM
One question, can I get the number of new email messages and display them in my website's homepage?

Thanks.
Title: After Login, redirect to another page
Post by: SKaero on January 25, 2012, 09:04:48 AM
Not easily but you could write a RoundCube plugin that would could get the email count.
Title: After Login, redirect to another page
Post by: Spaceman on January 25, 2012, 11:54:32 AM
I am also in need of full customization in RC, like changing the order of the 's in the Message List table.


from...









to...





(and I'm having trouble searching for the correct file to change this)


Am I walking into a world of hurt here? :/

:)
Title: After Login, redirect to another page
Post by: JohnDoh on January 25, 2012, 12:18:28 PM
you can change the default cols in the message list from the config.
Title: After Login, redirect to another page
Post by: SKaero on January 25, 2012, 12:22:07 PM
You should be able to drag and drop the columns.
Title: After Login, redirect to another page
Post by: Spaceman on January 25, 2012, 12:36:29 PM
JohnDoh:  nice, it works great. :)

skaero: you're right, but I need this change in the layout to be applied to every user. in fact, it would be better if I could turn that feature off.

This is to be used by elderly people, so I need to put away lots of options and just make available the basic functions of sending and reading e-mails. And of course, make things big for users with vision problem.

I will definitely need to make lots of changes, that's why I asked if I'm entering in a world of hurt.

Thanks to both of you!

:)