From ebc4324ecdac8fa0651c6cf635e87f78af126dcd Mon Sep 17 00:00:00 2001 From: Boris Gulay Date: Wed, 4 Sep 2019 23:21:46 +0300 Subject: [PATCH] Fixed login problem when server requires TLS. Closes #47 Closes #45 --- ident_switch.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ident_switch.php b/ident_switch.php index 13ca382..e377393 100644 --- a/ident_switch.php +++ b/ident_switch.php @@ -581,7 +581,11 @@ class ident_switch extends rcube_plugin if (!$_SESSION['password' . self::MY_POSTFIX]) $_SESSION['password' . self::MY_POSTFIX] = $_SESSION['password']; - $_SESSION['storage_host'] = $r['imap_host'] ? $r['imap_host'] : 'localhost'; // Default IMAP host here! + $host = $r['imap_host'] ? $r['imap_host'] : 'localhost'; // Default IMAP host here! + if ($ssl) + $host = "{$ssl}://{$host}"; + + $_SESSION['storage_host'] = $host; $_SESSION['storage_ssl'] = $ssl; $_SESSION['storage_port'] = $port; $_SESSION['username'] = $r['username'];