From 5f6c71ae36b73e5f94543eec2f61874cf46e9c62 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 16 Oct 2012 18:03:58 +0200 Subject: Fix return value of storage_connect() --- program/include/rcmail.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'program/include/rcmail.php') diff --git a/program/include/rcmail.php b/program/include/rcmail.php index ee144faca..ec3d537ec 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -2118,10 +2118,9 @@ class rcmail extends rcube } else { $this->set_storage_prop(); - return $storage->is_connected(); } } - return false; + return $storage->is_connected(); } } -- cgit v1.2.3 From df95e790ba49464dd6b093f0c45777288f738d7d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 18 Oct 2012 09:52:45 +0200 Subject: Remove automatic to-lowercase conversion of usernames (#1488715) --- CHANGELOG | 1 + config/main.inc.php.dist | 8 ++++---- program/include/rcmail.php | 20 +++++--------------- 3 files changed, 10 insertions(+), 19 deletions(-) (limited to 'program/include/rcmail.php') diff --git a/CHANGELOG b/CHANGELOG index e54da0f7c..c23210d37 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ 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) diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index a6661c323..371ccaf8c 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -226,10 +226,10 @@ $rcmail_config['login_autocomplete'] = 0; // 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: -// UPDATE users SET username = LOWER(username); -$rcmail_config['login_lc'] = 0; +// 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'] = 2; // Includes should be interpreted as PHP files $rcmail_config['skin_include_php'] = false; diff --git a/program/include/rcmail.php b/program/include/rcmail.php index ec3d537ec..0c2bf64b4 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -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; } -- cgit v1.2.3