Roundcube Community Forum

Miscellaneous => Roundcube Discussion => Topic started by: Metalik on September 02, 2012, 08:00:05 AM

Title: How login roundcube by php script?
Post by: Metalik on September 02, 2012, 08:00:05 AM
Hello

How can login roubdcube by php script?

There is a script http://blog.philippheckel.com/2008/05/16/roundcube-login-via-php-script/ but it does not support host (imap server)
We need to set host (imap server) something similar to login($username, $password,$host)

Title: Re: How login roundcube by php script?
Post by: w00t on September 12, 2012, 04:33:07 PM
Same problem for me:

My members log in login.php and they'll redirect to a member area (Roundcube 0.8.1 is install on roundcube/)

I would like to use $_SESSION['username'] and $_SESSION['password'] created from my login.php in my roundcube installation to avoid a double authentication.

I tried to use autologon plugin with $rcmail_config['plugins'] = array('autologon');

I also found following link, but seems doesn't work for me :
http://lists.roundcube.net/pipermail/users/2012-March/008369.html

I think the solution is wanted by many people.

Thanks.
Title: Re: How login roundcube by php script?
Post by: SKaero on September 13, 2012, 07:15:32 AM
You can't use the autologon plugin directly you'd need to modify it to fit your needs.
Title: Re: How login roundcube by php script?
Post by: w00t on September 13, 2012, 08:26:00 AM
Ok, so autologon plugin is the right way to do what I need ?

Code: [Select]
$args['user'] = $_SESSION['username'];
$args['pass'] = $_SESSION['password'];

I'll very appreciate if you could help me to found the solution (I'm not a good php dev')  ;D
Title: Re: How login roundcube by php script?
Post by: SKaero on September 13, 2012, 09:56:22 AM
Unfortunately its not so simple, in fact you'll need to come up with a different way of accessing the information because RoundCube doesn't use the same session as the rest of your site so you won't be able to access the stored information.
Title: Re: How login roundcube by php script?
Post by: w00t on September 13, 2012, 10:38:05 AM
Ok, so if I use the same session_name on my php scripts ? I didn't found the Roundcube session_name in rcube_session.php
Can I also POST my session variables with ajax, but I don't know where POST it, and I think tokens can block me, no ?
Title: Re: How login roundcube by php script?
Post by: SKaero on September 14, 2012, 05:08:00 PM
RoundCube uses a custom session handle so you can't easily tap into it. You could setup the autologin to accept posts so you could login that way.