Author Topic: logging in to roundcube from main site  (Read 34966 times)

Offline Adam

  • Jr. Member
  • **
  • Posts: 46
logging in to roundcube from main site
« on: August 19, 2006, 09:20:25 AM »
Hi,

Can anyone point me in the right direction? I would like users on one of my sites to be able to log in from the main site rather than going to the roundcube login page. Is this possible? I'm sure it is, I'm just not sure how! ::)

I'm assuming that somehow I need to incorporate this bit of code from login.html

Quote



" />


Any help appreciated!

Thanks

AD

Offline Adam

  • Jr. Member
  • **
  • Posts: 46
Re: logging in to roundcube from main site
« Reply #1 on: August 20, 2006, 09:47:41 AM »
I edited the login.html template - I thought it was going to be much more complicated thant it was!!

Ad

Offline scubalex

  • Newbie
  • *
  • Posts: 1
Re: logging in to roundcube from main site
« Reply #2 on: August 22, 2006, 11:43:49 AM »
I'm looking for the same function
I try by adress:
http://mywebsite/roundcube/index.php?_name=myaccount&_pass=mypass
but it didn't work
so I try this one:
http://mywebsite/roundcube/index.php?_name=myaccount&_pass=mypass&_action=login&_task=mail
but it didn't work
so I try to edit index.php to change $_POST into $_GET
but it didn't work
I'm still searching a solution ... :ticked:

Offline dracula

  • Newbie
  • *
  • Posts: 6
Re: logging in to roundcube from main site
« Reply #3 on: August 23, 2006, 03:04:26 PM »
this sure would be some interesting feature. I am using it like this on my actual instalation.
Users log in to my slight modified Joomla mainpage, when clicking on webmail the horde/imp webmail opens without needing user/password. If not logged in they are redirected to the joomla mainpage.

But there is NO WAY I am going to use it like this:
http://mywebsite/roundcube/index.php?_name=myaccount&_pass=mypass

this would be insane to have all passwords in some logfiles, or worse, in the browser history

Offline durandal

  • Newbie
  • *
  • Posts: 1
Re: logging in to roundcube from main site
« Reply #4 on: August 23, 2006, 09:37:21 PM »
I would be very interested by the capability to log in only once when I was in my main site.
I believe I found a beginning of a way with :

http://drupal.org/project/Mail
(Integration of the RoundCube Webmail in Drupal ... use of a single-sign-on)

But like the RoundCube code, it's is a very complicated code for me ...  :'(

If anyone has any solution for a single-sign-on ... ! (but avoid the password in the URL... ;) )

Thanx all

Offline Pazeg

  • Newbie
  • *
  • Posts: 1
Re: logging in to roundcube from main site
« Reply #5 on: January 31, 2007, 02:34:51 AM »
Do you mean a login for on a site where your users will enter their username password n go to the inbox? or you want the login be syncronized with a CMS or a forum??

If you are looking for a solution to the first Q then there u go

Code: [Select]
<form name=&quot;login&quot; action=&quot;[url]http://www.yourdomain.com/email/index.php&quot;[/url] method=&quot;post&quot; target=&quot;_blank&quot;>
<input type=&quot;text&quot; name=&quot;_user&quot; >
<input type=&quot;password&quot; name=&quot;_pass&quot; >
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Login&quot; class=&quot;submit&quot;>
<input name=&quot;_action&quot; value=&quot;login&quot; type=&quot;hidden&quot;>
</form>

Note the following.-
- edit the action="http://www.yourdomain.com/email/index.php" to target to your index.php file
- target="_blank" will open roundcube in a NEW WINDOW (remove it, if you want it to open in the same window)
- If you use the new window option, use a small javascript to clear the text boxes from the main page!

Offline denialfans

  • Newbie
  • *
  • Posts: 2
Re: logging in to roundcube from main site
« Reply #6 on: February 28, 2007, 05:15:30 PM »
I tried adding the form post to the front page of my website but all I get is "Your browser does not except cookies" when it goes to the roundcube page. It keeps the user name and the cursor is in the password field. Can anyone help me out?

Offline road

  • Newbie
  • *
  • Posts: 6
Re: logging in to roundcube from main site
« Reply #7 on: March 02, 2007, 01:14:46 PM »
I have another post (that was asked a little bit more recently that this one) a few items down on how to do this. If somebody is already logged into your existing site and you want to use those same credentials to bypass the roundcube logon, my method is working good for us. The bad part is it requires javascript but your end users do not have to see a form or hit another submit button. I believe this is the post http://roundcubeforum.net/forum/index.php?topic=729.0

Your problem sounds like your browser has cookies disabled and you need to enable them. If you do not know what cookies are this can help.
http://en.wikipedia.org/wiki/Web_cookie

Pretty much all browsers have a setting somewhere to enable and disable cookies. The form you added does nothing with cookies so what you are seeing is from your code.

Offline denialfans

  • Newbie
  • *
  • Posts: 2
Re: logging in to roundcube from main site
« Reply #8 on: March 30, 2007, 10:40:49 AM »
Thanks, I did this:
Quote from: minoan
Id did this:
Code: [Select]
// try to log in
if ($_action=='login' && $_task=='mail')
 {
 $host = rcmail_autoselect_host();
 
 // check if client supports cookies
 //if (empty($_COOKIE))
  //{
  //show_message(&quot;cookiesdisabled&quot;, 'warning');
  //}
 //else
  if (isset($_POST['_user']) && isset($_POST['_pass']) &&
      rcmail_login(get_input_value('_user', RCUBE_INPUT_POST),
       get_input_value('_pass', RCUBE_INPUT_POST, true, 'ISO-8859-1'), $host))
  {
  // send redirect
  header(&quot;Location: $COMM_PATH&quot;);
  exit;
  }
 else
  {
  show_message(&quot;loginfailed&quot;, 'warning');
  $_SESSION['user_id'] = '';
  }
 }
Now works perfect but it doesn't check for the cookie! I think that is not something which is needed!
and now I don't get the error.

Offline koshin

  • Newbie
  • *
  • Posts: 2
Re: logging in to roundcube from main site
« Reply #9 on: June 22, 2007, 08:22:29 AM »
I had the same problem, but i don't change anything in the code of rc.
I just put some cookie on my main page. when i try to login to rc, he check is there any cookie, and find my...

works.

Offline dabbish

  • Newbie
  • *
  • Posts: 5