From: hickert Date: Tue, 29 Sep 2009 09:33:09 +0000 (+0000) Subject: Fixed Copy & Paste group Membership X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=40b25bc671573056d4abb630a14e16bb5dedb1b1;p=gosa.git Fixed Copy & Paste group Membership git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14384 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 68866fa5b..3c9e99fbe 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -1600,6 +1600,22 @@ class posixAccount extends plugin # $this->savedGidNumber = $this->get_next_id("gidNumber", $this->dn); $this->savedGidNumber = ""; + /* Get group membership */ + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(objectClass=posixGroup)(memberUid=".$source['uid'][0]."))", array("cn", "description")); + + while ($attrs= $ldap->fetch()){ + if (!isset($attrs["description"][0])){ + $entry= $attrs["cn"][0]; + } else { + $entry= $attrs["cn"][0]." [".$attrs["description"][0]."]"; + } + $this->groupMembership[$ldap->getDN()]= $entry; + } + asort($this->groupMembership); + reset($this->groupMembership); + /* Fill group */ if(isset($source['gidNumber'][0])){ $this->primaryGroup= $source['gidNumber'][0];