Author Topic: [ASk] How to redirect login screen to roundcube  (Read 6668 times)

Offline ndlozor

  • Newbie
  • *
  • Posts: 3
[ASk] How to redirect login screen to roundcube
« on: February 12, 2009, 05:15:50 AM »
Hi guys,

On my server webmail is running roundcube at ip 172.18.4.21 with login roundcube page itself .
I have intranet web php on ip 172.18.4.22, I
make login php with submit button and it not same on login roundcube.

My big problem is, how to make intranet login username & password when this page submit directly log-in to server mail roundcube ?.

Thanks before guys..

Offline Julius Caesar

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 498
    • http://www.de-keizer.net/
[ASk] How to redirect login screen to roundcube
« Reply #1 on: February 12, 2009, 05:32:11 AM »
Your request is not really clear to me:

Do you want your RoundCube login-form on the server 172.18.4.22

or

Do you want just one login screen for your intranet and Roundcube, so once you've logged in you can go to RC without te enter your credentials
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he

Offline ndlozor

  • Newbie
  • *
  • Posts: 3
[ASk] How to redirect login screen to roundcube
« Reply #2 on: February 12, 2009, 06:30:05 AM »
Thanks for reply,

Ok, so let me explain more detail, The goal is
mail.mydomain.com is 172.18.4.21 have roundcobe login page.
And http://www.mydomain.com is 172.18.4.22 have login screen too but not same as roundcube login page, so once I've logged in at http://www.mydomain.com I can go to RC (mail.mydomain.com) without re enter login again.

Offline Julius Caesar

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 498
    • http://www.de-keizer.net/
[ASk] How to redirect login screen to roundcube
« Reply #3 on: February 12, 2009, 08:52:21 AM »
You may want to try it using an AJAX call and a button:


<?php

echo '<script type="text/javascript">';
echo 
'var url = "http://mail.mydomain.com/";';
echo 
'var params = "_user=". $_SESSION[\'username\'] ."&_pass=". $_SESSION[\'password\'] ."&_action=login";';

echo 
'function LoginRC() {';
echo 
'    http.open("POST", url, true);';
    
echo 
'    //Send the proper header infomation along with the request';
echo 
'    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");';
echo 
'    http.setRequestHeader("Content-length", params.length);';
echo 
'    http.setRequestHeader("Connection", "close");';

echo 
'    http.onreadystatechange = handler;';
echo 
'    http.send(params);';
echo 
'}';
echo 
'</script>';

<
SNIP>

echo 
'<input type="button" value="Webmail" onclick="LoginRC()" />'
?> 

The above code is not tested, but based on something I've found on the internet. Keep also in mind to use the right session variables.
« Last Edit: February 12, 2009, 09:06:15 AM by Julius Caesar »
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he

Offline Julius Caesar

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 498
    • http://www.de-keizer.net/
[ASk] How to redirect login screen to roundcube
« Reply #4 on: February 12, 2009, 09:10:03 AM »
Warning, when using the above code, the password is visible in the source code of the webpage, but maybe you can rebuild it to something more secure.
Julius Caesar

You can download the Groupvice4 theme here.
Sie können Groupvice4 hier he

Offline ndlozor

  • Newbie
  • *
  • Posts: 3
[ASk] How to redirect login screen to roundcube
« Reply #5 on: February 12, 2009, 10:04:57 PM »

echo '';
?>





I try to understand this script, but I'm getting wrong :
"object Expected on line 3 char 1"

Please help me to use this script, couse I'm not programmers.. :)

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
[ASk] How to redirect login screen to roundcube
« Reply #6 on: February 13, 2009, 12:01:35 AM »
Looks to me like a code snippet which needs jquery binded ...
Regards,
Rosali
__________________
MyRoundcube Project (commercial)