first, a note on strpos(). the result needs to be checked with the '===' operator to catch the difference between 0 or '' and FALSE. http://au2.php.net/strpos for more.
second, i'm not sure if the roundcube dev's want this functionality in or not, but wont this patch add the '@' and (if its set) the $CONFIG['domain'] string to all users logins, regardless of whether they need it?
assuming there is interest in incorporating this, i think the patch for program/include/main.inc shoule read:
if ($CONFIG['domain']) {
if (strpos($user, '@') === false) { $user .= $CONFIG['domain']; }
}
and the instructions in config/main.inc.php should include a directive to leave $CONFIG['domain'] set to false if not needed.
cheers justin
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';