diff --git a/phpgwapi/inc/class.accounts_ldap_wip.inc.php b/phpgwapi/inc/class.accounts_ldap_wip.inc.php index 5c9204a8ba..4c504d9df0 100644 --- a/phpgwapi/inc/class.accounts_ldap_wip.inc.php +++ b/phpgwapi/inc/class.accounts_ldap_wip.inc.php @@ -293,11 +293,17 @@ if ($this->data["account_type"] == "g" && $phpgw_info["server"]["ldap_group_context"] ) { $members = $this->members($this->data["account_id"]); - $entry["memberuid"] = ""; + $entry["memberuid"] = array(); for ($i=0;$iid2name($members[$i]['account_id']); - $entry["memberuid"][$i] = $this->id2name($members[$i]['account_id']); + //$currname = "@@".$this->id2name($members[$i]['account_id'])."@@"; + $currname = $this->id2name($members[$i]['account_id']); + //if (!ereg($currname, "@@" . join("@@", $entry["memberuid"]) . "@@")) + if (!$this->isin_array($currname,$entry["memberuid"])) + { + $entry["memberuid"][] = $currname; + } } unset($entry["givenname"]); unset($entry["sn"]); @@ -325,7 +331,6 @@ else { // attribute was in LDAP, modify it - //echo $val.' '; ldap_modify($ds, $allValues[0]["dn"], $tmpentry); } } @@ -340,6 +345,12 @@ } + function isin_array($needle,$haystack=array()) + { + for($i=0;$icreate($account_name, $account_type, $first_name, $last_name, $passwd);