Changeset e17553d in github
- Timestamp:
- Nov 30, 2010 8:43:04 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 489ffbd
- Parents:
- fd371a51
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcmail.php (modified) (2 diffs)
-
program/include/rcube_user.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rfd371a51 re17553d 4 4 - Plugin API: Add 'pass' argument in 'authenticate' hook (#1487134) 5 5 - Fix attachments of type message/rfc822 are not listed on attachments list 6 - Add 'login_lc' config option for case-insensitive authentication (#1487113) 6 7 7 8 RELEASE 0.5-BETA -
config/main.inc.php.dist
rfbe24e9 re17553d 183 183 // Allow browser-autocompletion on login form 184 184 $rcmail_config['login_autocomplete'] = false; 185 186 // If users authentication is not case sensitive this must be enabled. 187 // You can also use it to force conversion of logins to lower case. 188 $rcmail_config['login_lc'] = false; 185 189 186 190 // automatically create a new Roundcube user when log-in the first time. -
program/include/rcmail.php
r9016a84 re17553d 679 679 } 680 680 681 // Convert username to lowercase. If IMAP backend 682 // is case-insensitive we need to store always the same username (#1487113) 683 if ($config['login_lc']) { 684 $username = mb_strtolower($username); 685 } 686 681 687 // try to resolve email address from virtuser table 682 if (strpos($username, '@') )683 if ($virtuser = rcube_user::email2user($username))684 $username = $virtuser;688 if (strpos($username, '@') && ($virtuser = rcube_user::email2user($username))) { 689 $username = $virtuser; 690 } 685 691 686 692 // Here we need IDNA ASCII … … 705 711 // try with lowercase 706 712 $username_lc = mb_strtolower($username); 707 if ($username_lc != $username && ($imap_login = $this->imap->connect($host, $username_lc, $pass, $imap_port, $imap_ssl))) 708 $username = $username_lc; 713 if ($username_lc != $username) { 714 // try to find user record again -> overwrite username 715 if (!$user && ($user = rcube_user::query($username_lc, $host))) 716 $username_lc = $user->data['username']; 717 718 if ($imap_login = $this->imap->connect($host, $username_lc, $pass, $imap_port, $imap_ssl)) 719 $username = $username_lc; 720 } 709 721 } 710 722 -
program/include/rcube_user.php
r5c461ba re17553d 359 359 $dbh = rcmail::get_instance()->get_dbh(); 360 360 361 // use BINARY (case-sensitive) comparison on MySQL, other engines are case-sensitive 362 $prefix = preg_match('/^mysql/', $dbh->db_provider) ? 'BINARY ' : ''; 363 361 364 // query for matching user name 362 365 $query = "SELECT * FROM ".get_table_name('users')." WHERE mail_host = ? AND %s = ?"; 363 $sql_result = $dbh->query(sprintf($query, 'username'), $host, $user); 366 367 $sql_result = $dbh->query(sprintf($query, $prefix.'username'), $host, $user); 364 368 365 369 // query for matching alias 366 370 if (!($sql_arr = $dbh->fetch_assoc($sql_result))) { 367 $sql_result = $dbh->query(sprintf($query, 'alias'), $host, $user);371 $sql_result = $dbh->query(sprintf($query, $prefix.'alias'), $host, $user); 368 372 $sql_arr = $dbh->fetch_assoc($sql_result); 369 373 }
Note: See TracChangeset
for help on using the changeset viewer.
