I'm not at my computer, so I can't paste the code here, but I've actually used an environment variable to get the domain from the URL and then I've hidden the domain box.
On my server I've put roundcube (which rocks btw, congrats) on the generic webmail subdomain so it can be accessed from any domain. By detecting the domain in the URL, accessing it at webmail.domain1.com means that any username will automatically have @domain1.com appended to it (unless it already has an @, of course).
I'm not sure if you've plans for something similar to this in the future, or if there was a reason for not doing it, but it works great for my needs and makes the login screen that little bit simpler.
Ian
thomas brĂ¼derli wrote:
There are plans to implement the use of a virtusertable file to resolve real usernames by e-mail addresses. Until this is done, you could fill in the 'alias' col for registered users directly in your MySQL admin interface. This alias can be set to any string (not necessarly to the e-mail address) and will be searched on login.
Regards, Thomas
dianoga7@3dgo.net wrote:
For many people who have shared hosting, they are required to login with their full email addresses. Personally, I find this irritating. Thus...a very small bit of code to allow people to login both with or without their full address.
File: include/main.inc Function: rcmail_login Line #: 237 Code:
if (strpos($user, '@') == false){ $user = $user . '@' . $CONFIG['domain']; }
File: config/main.inc.php Line #: 35 (doesn't actually matter though) Code:
// Default Domain // Mainly for shared hosting servers. People that use cpanel, etc... // This will allow users to login without typing their full email address // As long as it actually exists on the default domain // The script will check to see if you have a domain in your username. // If not, this will be added to the end. // Set this to whatever comes after the @ in the email address $rcmail_config['domain'] = 'mydomain.com';