Remove automatic to-lowercase conversion of usernames (#1488715)
| | |
| | | CHANGELOG Roundcube Webmail |
| | | =========================== |
| | | |
| | | - Remove automatic to-lowercase conversion of usernames (#1488715) |
| | | - Fix scrolling quirk in email preview frame using Opera 12 (#1488763) |
| | | - Fix displaying of multipart/alternative messages with empty parts (#1488750) |
| | | - Fix threaded list sorting on PHP < 5.2.9 (#1488748) |
| | |
| | | |
| | | // Forces conversion of logins to lower case. |
| | | // 0 - disabled, 1 - only domain part, 2 - domain and local part. |
| | | // If users authentication is not case-sensitive this must be enabled. |
| | | // After enabling it all user records need to be updated, e.g. with query: |
| | | // If users authentication is case-insensitive this must be enabled. |
| | | // Note: After enabling it all user records need to be updated, e.g. with query: |
| | | // UPDATE users SET username = LOWER(username); |
| | | $rcmail_config['login_lc'] = 0; |
| | | $rcmail_config['login_lc'] = 2; |
| | | |
| | | // Includes should be interpreted as PHP files |
| | | $rcmail_config['skin_include_php'] = false; |
| | |
| | | $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']) { |
| | |
| | | $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; |
| | | } |
| | | |