From 0e1d9ce6072c3fd40080f48af2ce8b587989ffb6 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 10 Feb 2014 08:20:23 +0000 Subject: [PATCH] avoid problems with not set identity infos on global/group profiles by using the account information first for the main identity connected to the account, and ignoring the regarding info (not properly seeded) on iterating over identities --- mail/inc/class.mail_bo.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php index 2369ef51c4..d5774d66d2 100644 --- a/mail/inc/class.mail_bo.inc.php +++ b/mail/inc/class.mail_bo.inc.php @@ -529,13 +529,14 @@ class mail_bo foreach(emailadmin_account::search($only_current_user=true, $just_name=true) as $acc_id => $identity_name) { $acc = emailadmin_account::read($acc_id); + $userEMailAdresses[$acc['ident_id']] = array('acc_id'=>$acc_id,'ident_id'=>$acc['ident_id'],'ident_email'=>$acc['ident_email'],'ident_org'=>$acc['ident_org'],'ident_realname'=>$acc['ident_realname'],'ident_signature'=>$acc['ident_signature']); $identities = $acc->identities($acc_id); foreach($identities as $ik => $ident) { //error_log(__METHOD__.__LINE__.':'.$ik.'->'.array2string($ident)); $identity = emailadmin_account::read_identity($ik); //error_log(__METHOD__.__LINE__.':'.$ik.'->'.array2string($identity)); - $userEMailAdresses[$identity['ident_id']] = array('acc_id'=>$acc_id,'ident_id'=>$identity['ident_id'],'ident_email'=>$identity['ident_email'],'ident_org'=>$identity['ident_org'],'ident_realname'=>$identity['ident_realname'],'ident_signature'=>$identity['ident_signature']); + if (!isset($userEMailAdresses[$identity['ident_id']])) $userEMailAdresses[$identity['ident_id']] = array('acc_id'=>$acc_id,'ident_id'=>$identity['ident_id'],'ident_email'=>$identity['ident_email'],'ident_org'=>$identity['ident_org'],'ident_realname'=>$identity['ident_realname'],'ident_signature'=>$identity['ident_signature']); } } //error_log(__METHOD__.__LINE__.array2string($userEMailAdresses)); @@ -550,13 +551,14 @@ class mail_bo function getAccountIdentities($acc_id) { $userEMailAdresses = array(); $acc = emailadmin_account::read($acc_id); + $userEMailAdresses[$acc['ident_id']] = array('acc_id'=>$acc_id,'ident_id'=>$acc['ident_id'],'ident_email'=>$acc['ident_email'],'ident_org'=>$acc['ident_org'],'ident_realname'=>$acc['ident_realname'],'ident_signature'=>$acc['ident_signature']); $identities = $acc->identities(); foreach($identities as $ik => $ident) { //error_log(__METHOD__.__LINE__.':'.$ik.'->'.array2string($ident)); $identity = emailadmin_account::read_identity($ik); //error_log(__METHOD__.__LINE__.':'.$ik.'->'.array2string($identity)); - $userEMailAdresses[$identity['ident_id']] = array('ident_id'=>$identity['ident_id'],'ident_email'=>$identity['ident_email'],'ident_org'=>$identity['ident_org'],'ident_realname'=>$identity['ident_realname'],'ident_signature'=>$identity['ident_signature']); + if (!isset($userEMailAdresses[$identity['ident_id']])) $userEMailAdresses[$identity['ident_id']] = array('ident_id'=>$identity['ident_id'],'ident_email'=>$identity['ident_email'],'ident_org'=>$identity['ident_org'],'ident_realname'=>$identity['ident_realname'],'ident_signature'=>$identity['ident_signature']); } //error_log(__METHOD__.__LINE__.array2string($userEMailAdresses)); return $userEMailAdresses;