Author Topic: How do I prefill username and password for semi-auto login?  (Read 7193 times)

Offline blove57

  • Jr. Member
  • **
  • Posts: 18
How do I prefill username and password for semi-auto login?
« on: November 08, 2007, 10:24:55 AM »
I want to be able to give a link to Roundcube with the username and password in it so it is prefilled at the login screen. Something like http://mydomain.com/roundcube/index.php?username=john@mydomain.com&password=secret&host=mydomain.com

I tried doing this in roundcube\program\include\rcmail_template.inc:

...
 $input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'value' => $_GET['username']) + $attrib);
 $input_pass = new passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'size' => 30, 'value' => $_GET['password']) + $attrib);
 $input_host = new textfield(array('name' => '_host', 'id' => 'rcmloginhost', 'size' => 30, 'value' => $_GET['host']);
...

Notice the 'value' => $_GET['xxx'] I added. This doesn't work because Roundcube insists on making the value="" but don't know where it's doing this. Can anybody help me make this work?

Offline jaredy

  • Newbie
  • *
  • Posts: 5
Re: How do I prefill username and password for semi-auto login?
« Reply #1 on: November 09, 2007, 08:30:07 PM »
I don't know about you but that seems like a very unsecure way of automated login; having your password revealed as plain text in the URL.

Perhaps what you can do is go into config/main.inc.php , change the session_lifetime to a longer duration ?

Offline blove57

  • Jr. Member
  • **
  • Posts: 18
Re: How do I prefill username and password for semi-auto login?
« Reply #2 on: November 16, 2007, 10:38:58 PM »
Sure I see your point.. But I would at least like to be able to prefill the username and hostname. How can I do that in the code if rcmail_template.inc refuses to accept value parameters. Are these being overwritten somewhere else in the RoundCube code?