From a594d2f0b9956cf0b8ca835dbdc7917706b15cd7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 16 Sep 2006 10:00:06 +0000 Subject: [PATCH] =?UTF-8?q?make=C2=A0sure=C2=A0multiple=C2=A0email-address?= =?UTF-8?q?es=C2=A0in=C2=A0the=C2=A0mail=C2=A0attribute=C2=A0"survive"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpgwapi/inc/class.accounts_ldap.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index be896e3ac2..ca50aacb7f 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -230,6 +230,13 @@ class accounts_backend else { $to_write = $this->_merge_user($to_write,$data_utf8,!$old); + // make sure multiple email-addresses in the mail attribute "survive" + if (isset($to_write['mail']) && count($old['mail']) > 1) + { + $mail = $old['mail']; + $mail[0] = $to_write['mail']; + $to_write['mail'] = array_values(array_unique($mail)); + } $data['account_type'] = 'u'; } //echo "

ldap_".($old ? 'modify' : 'add')."(,$dn,".print_r($to_write,true).")

\n";