RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Recycle Bin > Recycle Bin

For more information about the ads and why they're here, please see the FAQ
Closed Thread
  #1  
Old 08-17-2006, 09:25 AM
Registered User
 
Join Date: Aug 2006
Posts: 2
Downloads: 0
Uploads: 0
Default Add domain name to right of username textbox

Okay, I have a request for a little bit of code.

First off, whenever you're viewing the login page of roundcube, you have your username/password boxes.

I would like to put my domain name off to the right of the username box. That way my users will know that they ONLY have to enter their username, and not their full email address.

So basically...they'll have the username text box where they enter their username. Right to the right of the text box, I either want just plain text that says "@mydomain.com", or...I want it to be in one of those greyed out text boxes that says "@mydomain.com".

What code would I use to make either of these, and where would I put it?

Thanks for your help. So far, I love this software.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 08-18-2006, 02:31 AM
ric ric is offline
Registered User
 
Join Date: Aug 2006
Posts: 6
Downloads: 0
Uploads: 0
Default Re: Add domain name to right of username textbox

Edit the following in program/include/main.inc

Line 1606 reads
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30));

Change to
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 15));

Line 1701 reads

$fields['user'] = $input_user->show(get_input_value('_user', RCUBE_INPUT_POST));

Change to
$fields['user'] = $input_user->show(get_input_value('_user', RCUBE_INPUT_POST)). " @DOMAIN.COM";

Credit to coolant for the code, taken from his 'Muliply Domains Login'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 08-25-2006, 11:26 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Downloads: 0
Uploads: 0
Default Re: Add domain name to right of username textbox


If you have more then one domain login and want your drop down box on the right of username, just change this in main.inc :


</tr><tr>


<td class="title"><label for="rcmloginhost">$labels[host]</label></td>
<td>$fields[host]</td>


EOF;

$OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('loginform ', '$form_name');");

$out = <<<EOF
$form_start
$SESS_HIDDEN_FIELD
$fields[action]
<table><tr>

<td class="title"><label for="rcmloginuser">$labels[user]</label></td>
<td>$fields[user]</td>

</tr><tr>

<td class="title"><label for="rcmloginpwd">$labels[pass]</label></td>
<td>$fields[pass]</td>
$form_host
</tr></table>
$form_end


To look like this :


</tr><tr>


EOF;

$OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('loginform ', '$form_name');");
··
$out = <<<EOF
$form_start
$SESS_HIDDEN_FIELD
$fields[action]
<table><tr>

<td class="title"><label for="rcmloginuser">$labels[user]</label></td>
<td>$fields[user]</td>

<td class="title"><label for="rcmloginhost">@</label></td>
<td>$fields[host]</td>

</tr><tr>

<td class="title"><label for="rcmloginpwd">$labels[pass]</label></td>
<td>$fields[pass]</td>
$form_host
</tr></table>
$form_end


If your mail servers is mail.domain.com and mail.domain1.com and you would like the drop down box
to just show your domains, just set your /config/main.inc.php to look like this!


Code:
// the mail host chosen to perform the log-in
// leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL connection, enter ssl://hostname:993
$rcmail_config['default_host'] = array('mail.domain.com'=>'domain.com',
                      'mail.domain1.com'=>'domain1.com');


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 11-16-2006, 11:59 PM
Registered User
 
Join Date: Nov 2006
Posts: 48
Downloads: 0
Uploads: 0
Default Re: Add domain name to right of username textbox

Quote:
Originally Posted by ric
Edit the following in program/include/main.inc

Line 1606 reads
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30));

Change to
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 15));

Line 1701 reads

$fields['user'] = $input_user->show(get_input_value('_user', RCUBE_INPUT_POST));

Change to
$fields['user'] = $input_user->show(get_input_value('_user', RCUBE_INPUT_POST)). " @DOMAIN.COM";

Credit to coolant for the code, taken from his 'Muliply Domains Login'
I followed this bit of code, but my login page will not accept the username without the @domain.com, I'm just getting "login failed". What else do I need to change to correct this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 11-17-2006, 03:46 AM
Registered User
 
Join Date: Nov 2006
Posts: 48
Downloads: 0
Uploads: 0
Default Re: Add domain name to right of username textbox

Never mind, I got it! It's in main.inc.php. Change yourdomain.co, to your domain.

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'] = 'yourdomain.com';
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 06:24 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community