Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: bcr666 on June 24, 2012, 10:54:18 PM

Title: logging in from another page php
Post by: bcr666 on June 24, 2012, 10:54:18 PM
Our users log in to our site, and I don't want them to have to log in a second time when they want to bring up their mail. Is there a way to login and bypass the index.php?
Title: Re: logging in from another page php
Post by: SKaero on June 25, 2012, 05:21:25 PM
You should be able to modify the autologin plugin to do what you want http://trac.roundcube.net/browser/github/plugins/autologon/autologon.php
Title: Re: logging in from another page php
Post by: bcr666 on June 25, 2012, 10:04:08 PM
I don't understand how autologin gets called or how to pass parameters to it.
Title: Re: logging in from another page php
Post by: SKaero on June 26, 2012, 02:28:02 PM
Normally it would get data statically or from a post, you may want to configure it to pull information out of a database.
Title: Re: logging in from another page php
Post by: bcr666 on June 28, 2012, 12:53:14 AM
OK, I've figured out how to turn on the AUTOLOGON plugin, and how to hard code the username password and host. The problem is that I need to either pass that information in, or look it up in a database (if I look it up in the database, I need a user_id). I am currently trying the database method, but the only things in my $_SESSION are:


[27-Jun-2012 22:47:56 -0600]: Array
(
    [language] => en_US
    [temp] => 1
)

How can I pass in the required information.
Title: Re: logging in from another page php
Post by: SKaero on June 28, 2012, 01:16:14 AM
RoundCube uses it own session management so you wont be able to access data directly via the session. You can pass it as get parameter in the url or in a cookie.
Title: Re: logging in from another page php
Post by: bcr666 on June 28, 2012, 02:23:20 PM
Wow, I'm so close. In testing, if I sign in as Bill, and log out of my app, then sign in as Bob, I see Bill's email. It appears that the sign-on only happens the first time. I've tried doing a /?_task=logout on page unload, but that doesn't seem to fix it.
Title: Re: logging in from another page php
Post by: SKaero on June 28, 2012, 03:25:58 PM
Using the startup hook you could check if the correct user is logged in and if not destroy the session.