Roundcube Community Forum

 

logging in from another page php

Started by bcr666, June 24, 2012, 10:54:18 PM

Previous topic - Next topic

bcr666

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?

SKaero


bcr666

I don't understand how autologin gets called or how to pass parameters to it.

SKaero

Normally it would get data statically or from a post, you may want to configure it to pull information out of a database.

bcr666

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.

SKaero

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.

bcr666

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.

SKaero

Using the startup hook you could check if the correct user is logged in and if not destroy the session.