From c82fbefa6e686865c0e8a9c9268795ca13bc8a2b Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 5 Jun 2007 11:56:00 +0000 Subject: [PATCH] Remove group acls too if group is removed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6549 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_groupGeneric.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index a80ddd944..114e32ae5 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -531,6 +531,24 @@ class group extends plugin $og->save (); } + /* 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 == "G:".$this->dn){ + unset($acl->gosaAclEntry[$id]['members'][$m_id]); + gosa_log("modify","groups/acl",$attrs['dn'],array(),sprintf("Removed acl for %s on object %s.",$this->dn,$attrs['dn'])); + } + } + } + $acl -> save(); + } + /* Send signal to the world that we've done */ $this->handle_post_events("remove"); } -- 2.30.2