mfreiholz / persistent_login

Provides a "Keep me logged in" aka "Remember Me" functionality for Roundcube.
78 stars 49 forks source link

Support for multiple hosts environment #3

Closed mfreiholz closed 12 years ago

mfreiholz commented 12 years ago

Actually the plugin doesn't work with multiple hosts, because neither the cookie- nor the token based version save the host value for an automatic login.

ghost commented 12 years ago

Hello where is the download link :-D

mfreiholz commented 12 years ago

The issue is still open and not fixed ;) I will probably fix it this afternoon.

ghost commented 12 years ago

ok, thank you

ghost commented 12 years ago

Hello

How is it going with programming the plugin? :-D

mfreiholz commented 12 years ago

Sorry, had a lot of work to do. I will fix this as soon as possible.

ghost commented 12 years ago

ok, thank you :-D

mfreiholz commented 12 years ago

Fixed and available for download from the "tags" page. Sourceforge download will come soon, too.

Halfwalker commented 10 years ago

Just set this up on a test system - Ubuntu 14.04, Roundcube 0.9.5. It looks like it's almost working. I might be misunderstanding something ... Using mysql for auth_tokens, and I can see new tokens being inserted.

mysql roundcube -e "select * from auth_tokens;" | 1453991243-A7NJjWuetvo4HYjm5w2mPzPyuF1Y | 2014-07-01 17:32:23 | 1 | userid@test.com | DHJ7QFMmISZt+8YmyznQ4K+aXGhNQy+N | localhost |

But as you can see, the host field is "localhost". Roundcube is running on the same box as Dovecot, so the default_host is set like

$rcmail_config['default_host'] = 'localhost';

Functionally, I can't tell if it's working. I still have to re-login. Do you any pointers for the configuration ?

THanks - D.

mfreiholz commented 10 years ago

Hi Halfwalker which other plugins do you use? In some cases the plugin order is very important. Try to set the "persistent_login"-plugin on the first position.

Did you also tried the non-token variant?

mfreiholz commented 10 years ago

Btw... i also just commited a small fix for logout. Maybe it's also important for your case. Use the trunk of the repository or release 4.1

Halfwalker commented 10 years ago

Got quite a few plugins :) and right now persistent_login is last. Will move it up front. Have not tried the non-token variant as this is on a Percona Xtradb Cluster environment, so the DB is being replicated. Very nice, but needs the info in the DB ...

'dkimstatus', 'emoticons', 'message_highlight', 'vcard_attachments', 'contextmenu', 'custom_from', 'markasjunk2', 'show_gravatar', 'sieverules', 'thunderbird_labels', 'google_addressbook', 'password', 'twofactor_gauthenticator', 'automatic_addressbook', 'persistent_login'

I installed from the zip, so did a git clone and the only change I saw was in persistent_login.php 414c414

< return rcmail::get_instance()->setcookie($name, "", time() - 60);

  return setcookie($name, "", time() - 60);

Was that the small fix or did I get it wrong ?

Thanks for the fast reply -

mfreiholz commented 10 years ago

Yes that's the small fix. Can't tell if it fixes your problem, but it was definitely a bug. Tell me, if it worked to put the plugin on the first position in the array.

Halfwalker commented 10 years ago

OK, working with it now, will let you know. How about the host ? How is that used in the token ? At first I thought it was the host that the browser was connecting from, but I'm not sure. Actually, could you explain the mechanism that persistent_login uses ?

Thanks -

mfreiholz commented 10 years ago

It's the host of the IMAP server. Roundcube is able to connect to multiple IMAP servers and the token needs to save this information, because its possible that "user1" exist for host "example1.com" and "example2.com"