Roundcube Community Forum

Release Support => Pending Issues => Topic started by: Jaffa on April 10, 2007, 07:51:14 AM

Title: Username Domain Drop-Down Menu.
Post by: Jaffa on April 10, 2007, 07:51:14 AM
I am trying to get a list on the login page for the domain. You see the server is localhost so there are no problems with that, but then people have to login using [email protected] and I would like to set it up so they just have to put in their username and then select the domain from a pop-up menu. I have tried doing this but it does not seem to work:

// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['username_domain'] = array('localhost' => 'domain1.net', 'localhost' => 'domain2.com.au');

Any ideas?

Cheers,

Jeff
Title: Re: Username Domain Drop-Down Menu.
Post by: eltonrauh on August 14, 2007, 08:22:01 AM
HI :)

     This is line > // This domain will be used to form e-mail addresses of new users
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['mail_domain'] = '';  

     Specific multiple the domain also?
Title: Re: Username Domain Drop-Down Menu.
Post by: dano on August 14, 2007, 01:44:10 PM
This mod was posted in the mod section quite some time ago and is used in the CPanel Password change mod as well. What they do is replace

// try to log in
if ($_action=='login' && $_task=='mail')
{
 $host = rcmail_autoselect_host();

With this

// try to log in
if(isset($_POST['_user']) && $_action == 'login' && $_task == 'mail')
 {
 if($_SERVER['SERVER_NAME'] and !preg_match('/(.*)\@(.*)/',$_POST['_user'])){
    $domain = preg_replace('/^(\w*)\./','',$_SERVER['SERVER_NAME']);
    $_POST['_user'] = $_POST['_user']."@".$domain;
 }

What that will do is allow the user to log in with just their user name and it will populate the @domain.com part with the domain name they are accessing. Rather than have my users chose from a list of domains which also shows them how many and what domains I host I prefer this method.
Title: Re: Username Domain Drop-Down Menu.
Post by: eltonrauh on August 14, 2007, 02:17:55 PM
Ok... but this code I insert in main.inc.php???

you have this main.inc.php?? I need equal with mine...


Thx alot..

Elton Rauh
Title: Re: Username Domain Drop-Down Menu.
Post by: kirk on August 14, 2007, 03:29:54 PM

  Use this function like the following:

 
Quote// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
$rcmail_config['username_domain'] = array('mail.xx.hu' => 'xx.hu', 'mail.xy.hu' => 'xy.hu', 'mail.xv.hu' => 'xv.hu');
Title: Re: Username Domain Drop-Down Menu.
Post by: eltonrauh on August 14, 2007, 03:42:36 PM
   
I the same have a server with HOST and domain differentââÂ,¬Ã,¦ what I make?


ex: $rcmail_config['default_host'] = array('192.168.1.10' => 'ccs.org.br', '192.168.1.10' => 'altera.com');


Att..

Elton Rauh
Title: Re: Username Domain Drop-Down Menu.
Post by: dano on August 14, 2007, 05:21:19 PM
Quote from: dano This mod was posted in the mod section quite some time ago and is used in the CPanel Password change mod as well. What they do is replace

// try to log in
if ($_action=='login' && $_task=='mail')
{
 $host = rcmail_autoselect_host();

With this

// try to log in
if(isset($_POST['_user']) && $_action == 'login' && $_task == 'mail')
 {
 if($_SERVER['SERVER_NAME'] and !preg_match('/(.*)\@(.*)/',$_POST['_user'])){
    $domain = preg_replace('/^(\w*)\./','',$_SERVER['SERVER_NAME']);
    $_POST['_user'] = $_POST['_user']."@".$domain;
 }

What that will do is allow the user to log in with just their user name and it will populate the @domain.com part with the domain name they are accessing. Rather than have my users chose from a list of domains which also shows them how many and what domains I host I prefer this method.

I'm sorry, these changes should be made to the index.php in the root folder of your RoundCube install.
Title: Re: Username Domain Drop-Down Menu.
Post by: eltonrauh on August 14, 2007, 08:24:19 PM
ahhh... ok... I will go test.... tomorrow... now I need go sleep... :) thx man...


cya...


Elton Rauh...
Title: Username Domain Drop-Down Menu.
Post by: Jaffa on January 01, 2009, 02:48:39 AM
Thanks for the replies guys, I havnt been around for a while and I'll probably get flamed for binging up an old post but I wanted to show my appreciation, and also a big thanks also to dano - that seemed to do the trick quite nicely :D