From 7813719af6befba2d72b8f5673f6c27e7e2dc03d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 8 Aug 2005 09:31:04 +0000 Subject: [PATCH] fixed bug with group memberships --- lam/HISTORY | 3 ++- lam/lib/modules/posixAccount.inc | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lam/HISTORY b/lam/HISTORY index da535134..d774dcb5 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,4 +1,4 @@ -??? 0.5.rc1 +08.08.2005 0.5.rc1 - Kolab 2 support - added manager and post office box for inetOrgPerson - Samba 3: added support for logon hours @@ -10,6 +10,7 @@ -> several fixes for PHP5 -> fixes for PDF editor and output -> password changing in tree view did not work + -> fixed changing of group memberships for users 30.06.2005 0.5.alpha2 diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index a2a2f63e..76494e0b 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -575,12 +575,12 @@ class posixAccount extends baseModule { $DNs = array_keys($dn_cns); foreach ($DNs as $DN) { if (is_array($add)) - if (in_array($dn_cns[$DN][0], $add)) $return[$DN]['add']['memberUid'] = $this->attributes['uid'][0]; + if (in_array($dn_cns[$DN][0], $add)) $return[$DN]['add']['memberUid'][] = $this->attributes['uid'][0]; if (is_array($remove)) - if (in_array($dn_cns[$DN][0], $remove)) $return[$DN]['remove']['memberUid'] = $this->attributes['uid'][0]; + if (in_array($dn_cns[$DN][0], $remove)) $return[$DN]['remove']['memberUid'][] = $this->attributes['uid'][0]; } // primary group mut also be removed if it has changed after setting additional groups - if (in_array($_SESSION['cache']->getgrnam($this->attributes['gidNumber'][0]), $this->groups_orig)) $return[$DN]['remove']['memberUid'] = $this->attributes['uid']; + if (in_array($_SESSION['cache']->getgrnam($this->attributes['gidNumber'][0]), $this->groups_orig)) $return[$DN]['remove']['memberUid'][] = $this->attributes['uid']; } else { // Add user to every group @@ -588,7 +588,7 @@ class posixAccount extends baseModule { // get_cache will return an array ( dn1 => array(cn1), dn2 => array(cn2), ... ) $DNs = array_keys($dn_cns); foreach ($DNs as $DN) { - if (in_array($dn_cns[$DN][0], $this->groups)) $return[$DN]['add']['memberUid'] = $this->attributes['uid'][0]; + if (in_array($dn_cns[$DN][0], $this->groups)) $return[$DN]['add']['memberUid'][] = $this->attributes['uid'][0]; } } } @@ -599,7 +599,7 @@ class posixAccount extends baseModule { // get_cache will return an array ( dn1 => array(cn1), dn2 => array(cn2), ... ) $DNs = array_keys($dn_cns); foreach ($DNs as $DN) { - if (in_array($dn_cns[$DN][0], $this->orig['groups'])) $return[$DN]['remove']['memberUid'] = $this->attributes['uid'][0]; + if (in_array($dn_cns[$DN][0], $this->orig['groups'])) $return[$DN]['remove']['memberUid'][] = $this->attributes['uid'][0]; } } }