correctly set Vacation Cache when acting on behalf of another user

This commit is contained in:
Klaus Leithoff 2016-01-28 10:51:51 +00:00
parent d9759cced8
commit 7d1782ecc0

View File

@ -634,9 +634,17 @@ class mail_sieve
self::setAsyncJob($newVacation);
}
//Reset vacationNotice cache which is used in mail_ui get_rows
if (isset($account_id) && $this->mail_admin)
{
$accont_lid = accounts::id2name($account_id,'account_lid');
$cachedVacations = array($icServer->acc_id => $newVacation) + (array)egw_cache::getCache(egw_cache::INSTANCE, 'email', 'vacationNotice'.$accont_lid);
egw_cache::setCache(egw_cache::INSTANCE,'email', 'vacationNotice'.$accont_lid, $cachedVacations);
}
else
{
$cachedVacations = array($icServer->acc_id => $newVacation) + (array)egw_cache::getCache(egw_cache::INSTANCE, 'email', 'vacationNotice'.$GLOBALS['egw_info']['user']['account_lid']);
egw_cache::setCache(egw_cache::INSTANCE,'email', 'vacationNotice'.$GLOBALS['egw_info']['user']['account_lid'], $cachedVacations);
}
$msg = lang('Vacation notice sucessfully updated.');
}
}