summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 03961c7)
raw | patch | inline | side by side (parent: 03961c7)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Jul 2009 08:15:47 +0000 (08:15 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Jul 2009 08:15:47 +0000 (08:15 +0000) |
-When a user is removed, remove it from roles too.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13897 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13897 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/generic/class_user.inc | patch | blob | history |
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index 95b0960a776688278cf228970058fa87b9e66f37..30c50e47516dade4e0a802b400119bae7851dbf1 100644 (file)
$og->save ();
}
+ /* Delete references to roles */
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->search ("(&(objectClass=organizationalRole)(roleOccupant=".LDAP::prepare4filter($this->dn)."))", array("cn"));
+ while ($ldap->fetch()){
+ $role= new roleGeneric($this->config, $ldap->getDN());
+ $key = array_search($this->dn,$role->roleOccupant);
+ if($key !== FALSE){
+ unset($role->roleOccupant[$key]);
+ $role->reload();
+ $role->save ();
+ }
+ }
+
/* If needed, let the password method do some cleanup */
$tmp = new passwordMethod($this->config);
$available = $tmp->get_available_methods();
/* Only force save of changes ....
If this attributes aren't changed, avoid saving.
*/
+
if($this->gender=="0") $this->gender ="";
if($this->preferredLanguage=="0") $this->preferredLanguage ="";