Fix autoselect_host() for login (#1488297)

pull/1/head
thomascube 13 years ago
parent 567be64c28
commit 48f04d368e

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Fix autoselect_host() for login (#1488297)
- Fix drafts update issues when edited from preview pane (#1488314) - Fix drafts update issues when edited from preview pane (#1488314)
- Changed license to GNU GPLv3+ with exceptions for skins & plugins - Changed license to GNU GPLv3+ with exceptions for skins & plugins
- Make mime type detection based on filename extension to be case-insensitive - Make mime type detection based on filename extension to be case-insensitive

@ -1020,16 +1020,21 @@ class rcmail
list($user, $domain) = explode('@', get_input_value('_user', RCUBE_INPUT_POST)); list($user, $domain) = explode('@', get_input_value('_user', RCUBE_INPUT_POST));
if (!empty($domain)) { if (!empty($domain)) {
foreach ($default_host as $storage_host => $mail_domains) { foreach ($default_host as $storage_host => $mail_domains) {
if (is_array($mail_domains) && in_array($domain, $mail_domains)) { if (is_array($mail_domains) && in_array_nocase($domain, $mail_domains)) {
$host = $storage_host; $host = $storage_host;
break; break;
} }
else if (stripos($storage_host, $domain) !== false || stripos(strval($mail_domains), $domain) !== false) {
$host = is_numeric($storage_host) ? $mail_domains : $storage_host;
break;
}
} }
} }
// take the first entry if $host is still an array // take the first entry if $host is still not set
if (empty($host)) { if (empty($host)) {
$host = array_shift($default_host); list($key, $val) = each($default_host);
$host = is_numeric($key) ? $val : $key;
} }
} }
else if (empty($default_host)) { else if (empty($default_host)) {

Loading…
Cancel
Save