Roundcube Community Forum

 

After Login, redirect to another page

Started by Spaceman, January 24, 2012, 12:28:25 PM

Previous topic - Next topic

Spaceman

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.

:)

SKaero

Try adding a redirect to your homepage using the login_after Plugin_Hooks hook.

Spaceman

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;
  }
}
?>

Spaceman

One question, can I get the number of new email messages and display them in my website's homepage?

Thanks.

SKaero

Not easily but you could write a RoundCube plugin that would could get the email count.

Spaceman

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? :/

:)

JohnDoh

you can change the default cols in the message list from the config.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

SKaero

You should be able to drag and drop the columns.

Spaceman

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!

:)