From: hickert Date: Tue, 5 Jun 2007 11:53:49 +0000 (+0000) Subject: Remove user acls too, if user is removed X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=41d12273fc14fa2440a86ff8b34f318836631c33;p=gosa.git Remove user acls too, if user is removed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6548 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 724ed9007..c2f6a2f09 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -653,6 +653,23 @@ class user extends plugin kadm5_destroy($handle); } + /* Remove ACL dependencies too, + */ + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(objectClass=gosaAcl)(gosaAclEntry=*".base64_encode($this->dn)."*))",array("gosaAclEntry","dn")); + while($attrs = $ldap->fetch()){ + $acl = new acl($this->config,$this->parent,$attrs['dn']); + foreach($acl->gosaAclEntry as $id => $entry){ + foreach($entry['members'] as $m_id => $member){ + if($m_id == "U:".$this->dn){ + unset($acl->gosaAclEntry[$id]['members'][$m_id]); + gosa_log("modify","users/acl",$attrs['dn'],array(),sprintf("Removed acl for %s on object %s.",$this->dn,$attrs['dn'])); + } + } + } + $acl -> save(); + } /* Optionally execute a command after we're done */ $this->handle_post_events("remove",array("uid" => $this->uid));