* Mail/SAML/SSO: show mail accounts requiring the session password as Error, but load the other accounts

This commit is contained in:
ralf 2022-09-15 15:57:29 +02:00
parent a050612165
commit 6b3b1a82e6

View File

@ -479,15 +479,17 @@ class mail_tree
{
$roots = array(Tree::ID => 0, Tree::CHILDREN => array());
foreach(Mail\Account::search(true, false) as $acc_id => $accObj)
foreach(Mail\Account::search(true, 'params') as $acc_id => $params)
{
try {
$accObj = new Mail\Account($params);
if (!$accObj->is_imap()|| $_profileID && $acc_id != $_profileID) continue;
$identity = self::getIdentityName(Mail\Account::identity_name($accObj,true, $GLOBALS['egw_info']['user']['account_id'], true));
// Open top level folders for active account
$openActiveAccount = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] == $acc_id?1:0;
$baseNode = array(
Tree::ID=> (string)$acc_id,
Tree::ID => (string)$acc_id,
Tree::LABEL => str_replace(array('<','>'),array('[',']'),$identity),
Tree::TOOLTIP => '('.$acc_id.') '.htmlspecialchars_decode($identity),
Tree::IMAGE_LEAF => self::$leafImages['folderAccount'],
@ -497,7 +499,7 @@ class mail_tree
Tree::CHILDREN => array(), // dynamic loading on unfold
Tree::AUTOLOAD_CHILDREN => true,
'parent' => '',
Tree::OPEN => $_openTopLevel?$_openTopLevel:$openActiveAccount,
Tree::OPEN => $_openTopLevel?:$openActiveAccount,
// mark on account if Sieve is enabled
'data' => array(
'sieve' => $accObj->imapServer()->acc_sieve_enabled,
@ -506,6 +508,23 @@ class mail_tree
),
Tree::NOCHECKBOX => $_noCheckbox
);
}
catch (\Exception $ex) {
$baseNode = array(
Tree::ID => (string)$acc_id,
Tree::LABEL => lang('Error').': '.lang($ex->getMessage()),
Tree::TOOLTIP => '('.$acc_id.') '.htmlspecialchars_decode($params['acc_name']),
Tree::IMAGE_LEAF => self::$leafImages['folderAccount'],
Tree::IMAGE_FOLDER_OPEN => self::$leafImages['folderAccount'],
Tree::IMAGE_FOLDER_CLOSED => self::$leafImages['folderAccount'],
'path'=> array($acc_id),
Tree::CHILDREN => array(), // dynamic loading on unfold
Tree::AUTOLOAD_CHILDREN => false,
'parent' => '',
Tree::OPEN => false,
Tree::NOCHECKBOX => true
);
}
self::setOutStructure($baseNode, $roots,self::DELIMITER);
}
return $roots;