Backport commit r47976, committed by Leithoff. Do not use Session to cache HierarchyDelimiter

This commit is contained in:
Hadi Nategh 2014-08-22 12:57:41 +00:00
parent 00c348e21f
commit cca8e33942

View File

@ -973,7 +973,7 @@ class emailadmin_imapbase
function getHierarchyDelimiter($_useCache=true) function getHierarchyDelimiter($_useCache=true)
{ {
static $HierarchyDelimiter; static $HierarchyDelimiter;
if (is_null($HierarchyDelimiter)) $HierarchyDelimiter =& egw_cache::getSession('mail','HierarchyDelimiter'); if (is_null($HierarchyDelimiter)) $HierarchyDelimiter = egw_cache::getCache(egw_cache::INSTANCE,'email','HierarchyDelimiter'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*60*24*5);
if ($_useCache===false) unset($HierarchyDelimiter[$this->icServer->ImapServerId]); if ($_useCache===false) unset($HierarchyDelimiter[$this->icServer->ImapServerId]);
if (isset($HierarchyDelimiter[$this->icServer->ImapServerId])&&!empty($HierarchyDelimiter[$this->icServer->ImapServerId])) if (isset($HierarchyDelimiter[$this->icServer->ImapServerId])&&!empty($HierarchyDelimiter[$this->icServer->ImapServerId]))
{ {
@ -988,6 +988,7 @@ class emailadmin_imapbase
{ {
$HierarchyDelimiter[$this->icServer->ImapServerId] = '/'; $HierarchyDelimiter[$this->icServer->ImapServerId] = '/';
} }
egw_cache::setCache(egw_cache::INSTANCE,'email','HierarchyDelimiter'.trim($GLOBALS['egw_info']['user']['account_id']),$HierarchyDelimiter, $expiration=60*60*24*5);
return $HierarchyDelimiter[$this->icServer->ImapServerId]; return $HierarchyDelimiter[$this->icServer->ImapServerId];
} }