RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Third Party Contributions > Plug-Ins

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 08-23-2007, 09:34 PM
Registered User
 
Join Date: Aug 2007
Posts: 1
Downloads: 0
Uploads: 0
Default Domain Autocomplete

I've created a small plug-in that will auto-complete the email address with the domain name when logging in. So, instead of typing "user@domain.com", you can just type "user" and when the username field loses focus, the "@domain.com" will automatically be added.

I've put the instructions on my blog at http://www.loganrockmore.com/blog/?p=120 and I'll repeat them here:

Quote:
Open program/include/main.inc. On line 1446, replace

Code:
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off'));
with the two lines

Code:
$domain = preg_replace("/^www\./", "", $_SERVER['HTTP_HOST']);
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off', 'onchange' => 'domainautocomplete(\'' . $domain . '\');'));
(Note: if your Roundcube installation is located somewhere like webmail.domain.com, then change “www” in the first line to “webmail”. Basically, that line just gets rid of the first part of the domain, so you’re left with “domain.com” )

Open program/include/rcmail_template.inc. On line 60, after

Code:
$this->include_script('app.js');
add the line

Code:
$this->include_script('domainautocomplete.js');
Finally, in the directory program/js/ create a new file titled domainautocomplete.js and add this content

Code:
function domainautocomplete(domain) {
  
  var loginField = document.getElementById('rcmloginuser');
  
  if( loginField.value != '' &&
    loginField.value.indexOf('@') == -1 ) {
    
    loginField.value = loginField.value + "@" + domain;
  }
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 08-23-2007, 11:57 PM
Super Moderator
 
Join Date: Jun 2006
Posts: 431
Downloads: 0
Uploads: 0
Send a message via ICQ to skaero Send a message via AIM to skaero Send a message via MSN to skaero Send a message via Yahoo to skaero
Default Re: Domain Autocomplete

Or... you could just go in to config/main.inc.php and edit this to:
Code:
$rcmail_config['username_domain'] = 'domain.com';
That would work to.
__________________
[size=8pt]SKaero.com <br />&nbsp; [/size]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 12-14-2007, 06:53 AM
Registered User
 
Join Date: Jan 2007
Posts: 2
Downloads: 0
Uploads: 0
Default Re: Domain Autocomplete

How to change «@» on «+» in address autocomplete? Our provider maked logins for email such: e-mail: test@domain.com, but login: test+domain.com and domain.com+test. I need solutuion for two my examples. Help, please
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 12-16-2007, 12:14 AM
Super Moderator
 
Join Date: Jun 2006
Posts: 431
Downloads: 0
Uploads: 0
Send a message via ICQ to skaero Send a message via AIM to skaero Send a message via MSN to skaero Send a message via Yahoo to skaero
Default Re: Domain Autocomplete

Have you tried my solution? It doesn't have any of the js files and its built into round cube so that should work.
__________________
[size=8pt]SKaero.com <br />&nbsp; [/size]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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 03:58 PM.


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