From ab7bae56b5dc8bfa7d64dfd6d90b76a8b8a92e8d Mon Sep 17 00:00:00 2001 From: Boris Gulay Date: Mon, 30 May 2016 01:45:40 +0300 Subject: [PATCH] Fixed unable to switch to default ident after two or more time switching between another identities. --- ident_switch.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ident_switch.php b/ident_switch.php index a52d457..988463d 100644 --- a/ident_switch.php +++ b/ident_switch.php @@ -398,12 +398,14 @@ class ident_switch extends rcube_plugin { if (strncasecmp($k, 'storage', 7) === 0 && substr_compare($k, $this->my_postfix, -$my_postfix_len, $my_postfix_len) !== 0) { - $_SESSION[$k . $this->my_postfix] = $_SESSION[$k]; + if (!$_SESSION[$k . $this->my_postfix]) + $_SESSION[$k . $this->my_postfix] = $_SESSION[$k]; $rc->session->remove($k); } } } - $_SESSION['password' . $this->my_postfix] = $_SESSION['password']; + if (!$_SESSION['password' . $this->my_postfix]) + $_SESSION['password' . $this->my_postfix] = $_SESSION['password']; $_SESSION['storage_host'] = $r['host'] ? $r['host'] : 'localhost'; // Default host here! $_SESSION['storage_ssl'] = $ssl;