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/rcmail.php | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/program/include/rcmail.php b/program/include/rcmail.php index ab2c161..1c98106 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -699,12 +699,12 @@ // Here we need IDNA ASCII // Only rcube_contacts class is using domain names in Unicode - $host = idn_to_ascii($host); + $host = rcube_idn_to_ascii($host); if (strpos($username, '@')) { // lowercase domain name list($local, $domain) = explode('@', $username); $username = $local . '@' . mb_strtolower($domain); - $username = idn_to_ascii($username); + $username = rcube_idn_to_ascii($username); } // user already registered -> overwrite username @@ -768,6 +768,7 @@ // login succeeded if (is_object($user) && $user->ID) { $this->set_user($user); + $this->session_configure(); // set session vars $_SESSION['user_id'] = $user->ID; @@ -925,6 +926,22 @@ /** + * Check if the given text lable exists + * + * @param string Label name + * @return boolean True if text exists (either in the current language or in en_US) + */ + public function text_exists($name, $domain=null) + { + // load localization files if not done yet + if (empty($this->texts)) + $this->load_language(); + + // check for text with domain first + return ($domain && isset($this->texts[$domain.'.'.$name])) || isset($this->texts[$name]); + } + + /** * Load a localization package * * @param string Language ID -- Gitblit v1.9.1