From 40b25bc671573056d4abb630a14e16bb5dedb1b1 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 29 Sep 2009 09:33:09 +0000 Subject: [PATCH] Fixed Copy & Paste group Membership git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14384 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/posix/class_posixAccount.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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]; -- 2.30.2