From e2ee971ac71fb9e44b1980642d6d0a45a6722223 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 16 Sep 2006 09:59:29 +0000 Subject: [PATCH] =?UTF-8?q?"editaccountemail"=C2=A0hook=C2=A0to=C2=A0allow?= =?UTF-8?q?=C2=A0other=C2=A0apps=C2=A0to=C2=A0monitor=C2=A0the=C2=A0change?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addressbook/inc/class.so_ldap.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.so_ldap.inc.php b/addressbook/inc/class.so_ldap.inc.php index d4e88ff033..daa8fa803f 100644 --- a/addressbook/inc/class.so_ldap.inc.php +++ b/addressbook/inc/class.so_ldap.inc.php @@ -351,7 +351,7 @@ class so_ldap } // check the existing objectclasses of an entry, none = array() for new ones $oldObjectclasses = array(); - $attributes = array('dn','cn','objectClass','uid'); + $attributes = array('dn','cn','objectClass','uid','mail'); $contactUID = $this->data[$this->contacts_id]; if(!empty($contactUID) && ($result = ldap_search($this->ds, $GLOBALS['egw_info']['server']['ldap_contact_context'], @@ -412,6 +412,14 @@ class so_ldap } if($isUpdate) { + // make sure multiple email-addresses in the mail attribute "survive" + if (isset($ldapContact['mail']) && $oldContactInfo[0]['mail']['count'] > 1) + { + $mail = $oldContactInfo[0]['mail']; + unset($mail['count']); + $mail[0] = $ldapContact['mail']; + $ldapContact['mail'] = array_values(array_unique($mail)); + } // update entry $dn = $oldContactInfo[0]['dn']; $needRecreation = false;