From ab0b51a1fef87bcc643c3aaf2e635c811b28ccd8 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Tue, 15 Feb 2011 06:10:59 -0500 Subject: [PATCH] - Use only one from IMAP authentication methods to prevent login delays (1487784) --- program/include/rcube_user.php | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/program/include/rcube_user.php b/program/include/rcube_user.php index ca4fb8b..75faf47 100644 --- a/program/include/rcube_user.php +++ b/program/include/rcube_user.php @@ -359,16 +359,15 @@ $dbh = rcmail::get_instance()->get_dbh(); // use BINARY (case-sensitive) comparison on MySQL, other engines are case-sensitive - $prefix = preg_match('/^mysql/', $dbh->db_provider) ? 'BINARY ' : ''; + $mod = preg_match('/^mysql/', $dbh->db_provider) ? 'BINARY' : ''; // query for matching user name - $query = "SELECT * FROM ".get_table_name('users')." WHERE mail_host = ? AND %s = ?"; - - $sql_result = $dbh->query(sprintf($query, $prefix.'username'), $host, $user); + $query = "SELECT * FROM ".get_table_name('users')." WHERE mail_host = ? AND %s = $mod ?"; + $sql_result = $dbh->query(sprintf($query, 'username'), $host, $user); // query for matching alias if (!($sql_arr = $dbh->fetch_assoc($sql_result))) { - $sql_result = $dbh->query(sprintf($query, $prefix.'alias'), $host, $user); + $sql_result = $dbh->query(sprintf($query, 'alias'), $host, $user); $sql_arr = $dbh->fetch_assoc($sql_result); } -- Gitblit v1.9.1