fixed PHP warning: Illegal offset type in phpgwapi/inc/class.accounts_ldap.inc.php on line 1100 and not working update of group mail addresses

This commit is contained in:
Ralf Becker 2010-07-21 14:20:31 +00:00
parent f597385a9c
commit f7c1f243ae

View File

@ -1093,11 +1093,14 @@ class accounts_ldap
if ($this->id2name($gid,'account_email') && ($objectclass = $this->id2name($gid,'mailAllowed')))
{
$forward = $this->group_mail_classes[$objectclass];
if (is_array($forward)) list($forward,$extra_attr) = each($forward);
$to_write[$forward] = array();
if ($extra_attr) $to_write[$extra_attr] = array();
foreach($members as $key => $member)
{
if (($email = $this->id2name($member,'account_email'))) $to_write[$forward][] = $email;
if ($extra_attr && ($uid = $this->id2name($member,'account_lid'))) $to_write[$extra_attr] = $uid;
}
}
if (!ldap_modify($this->ds,'cn='.ldap::quote($cn).','.$this->group_context,$to_write))