Code

Remove group acls too if group is removed
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Jun 2007 11:56:00 +0000 (11:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Jun 2007 11:56:00 +0000 (11:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6549 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupGeneric.inc

index a80ddd9444f984c753e63235341fcae342bb914c..114e32ae5bc6ff5739edbe75d1a342e6304dc960 100644 (file)
@@ -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");
   }