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;
}
}
|