fixed bug with group memberships

This commit is contained in:
Roland Gruber 2005-08-08 09:31:04 +00:00
parent 1df507d3d4
commit 7813719af6
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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];
}
}
}