summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-01-08 08:37:55 +0000
committeralecpl <alec@alec.pl>2011-01-08 08:37:55 +0000
commit808d1617ef17d8ae33cbc6533cf391c31123c0da (patch)
tree30b0a68091f3ecc3ef13eeb1ab63e36a31fa02ef /program/include
parenta3861ba02f0ad7fdec4e13bab8a4194f920733a5 (diff)
- Fix fallback to LOGIN auth (broken in r4389)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap_generic.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index b11266fd7..166a106a1 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -768,10 +768,14 @@ class rcube_imap_generic
$auth_methods = $auth_caps;
}
// RFC 2595 (LOGINDISABLED) LOGIN disabled when connection is not secure
- if (($key = array_search('LOGIN', $auth_methods)) !== false
- && $this->getCapability('LOGINDISABLED')
- ) {
- unset($auth_methods[$key]);
+ $login_disabled = $this->getCapability('LOGINDISABLED');
+ if (($key = array_search('LOGIN', $auth_methods)) !== false) {
+ if ($login_disabled) {
+ unset($auth_methods[$key]);
+ }
+ }
+ else if (!$login_disabled) {
+ $auth_methods[] = 'LOGIN';
}
}
else {