From d5d6f4daf9ac8524b2f1ddf04fbbd0d48582a30c Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 26 Aug 2013 14:27:46 +0000 Subject: [PATCH] make sure possible instance is unset before recreating the entry; correct condition on InstanceCreation when icServerObject is passed; unset cachedObjects for Instance --- felamimail/inc/class.felamimail_bo.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index 419635c31d..b5761fcf7f 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -195,8 +195,10 @@ class felamimail_bo public static function getInstance($_restoreSession=true, $_profileID=0, $_validate=true, $_icServerObject=null) { //special case; we get the desired object passed as we need it for the occasion. - if (!is_null($_icServerObject)&&!isset(self::$instances[$_profileID]) || $_restoreSession===false) + if (!is_null($_icServerObject)&&(!isset(self::$instances[$_profileID]) || $_restoreSession===false)) { + self::unsetInstance($_profileID); //make sure we reconstruct it + emailadmin_bo::unsetCachedObjects($_profileID); self::$instances[$_profileID] = new felamimail_bo('utf-8',$_restoreSession,$_profileID,$_icServerObject); //error_log(__METHOD__.__LINE__.array2string(self::$instances[$_profileID]->mailPreferences->getIncomingServer($_profileID))); return self::$instances[$_profileID];