diff options
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r-- | program/include/rcmail.php | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index ec3d537ec..c2f76b388 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -258,8 +258,8 @@ class rcmail extends rcube $autocomplete = (array) $this->config->get('autocomplete_addressbooks'); $list = array(); - // We are using the DB address book - if ($abook_type != 'ldap') { + // We are using the DB address book or a plugin address book + if ($abook_type != 'ldap' && $abook_type != '') { if (!isset($this->address_books['0'])) $this->address_books['0'] = new rcube_contacts($this->db, $this->get_user_id()); $list['0'] = array( @@ -452,6 +452,10 @@ class rcmail extends rcube $username .= '@'.rcube_utils::parse_host($config['username_domain'], $host); } + if (!isset($config['login_lc'])) { + $config['login_lc'] = 2; // default + } + // Convert username to lowercase. If storage backend // is case-insensitive we need to store always the same username (#1487113) if ($config['login_lc']) { @@ -483,21 +487,7 @@ class rcmail extends rcube $storage = $this->get_storage(); // try to log in - if (!($login = $storage->connect($host, $username, $pass, $port, $ssl))) { - // try with lowercase - $username_lc = mb_strtolower($username); - if ($username_lc != $username) { - // try to find user record again -> overwrite username - if (!$user && ($user = rcube_user::query($username_lc, $host))) - $username_lc = $user->data['username']; - - if ($login = $storage->connect($host, $username_lc, $pass, $port, $ssl)) - $username = $username_lc; - } - } - - // exit if login failed - if (!$login) { + if (!$storage->connect($host, $username, $pass, $port, $ssl)) { return false; } @@ -2112,8 +2102,7 @@ class rcmail extends rcube if (!$storage->connect($host, $user, $pass, $port, $ssl)) { if (is_object($this->output)) { - $error = $storage->get_error_code() == -1 ? 'storageerror' : 'sessionerror'; - $this->output->show_message($error, 'error'); + $this->output->show_message('storageerror', 'error'); } } else { |