Code

Update groups acls, if group dn has changed
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 13:48:13 +0000 (13:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 17 Sep 2007 13:48:13 +0000 (13:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7308 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupGeneric.inc
plugins/personal/generic/class_user.inc

index da836f268985ef296f1b6b3123221a5b02a036cc..aad633524e04bfe4717a8379c9c48a03b65d2ca6 100644 (file)
@@ -549,6 +549,11 @@ class group extends plugin
       $acl -> save();
     }
 
+    /* Remove ACL dependencies too,
+     */
+    $tmp = new acl($this->config,$this->parent,$this->dn);
+    $tmp->remove_acl();
+
     /* Send signal to the world that we've done */
     $this->handle_post_events("remove");
   }
@@ -764,6 +769,13 @@ class group extends plugin
     $this->cleanup();
     $ldap->$mode($this->attrs);
 
+    /* Remove ACL dependencies too,
+     */
+    if($this->dn != $this->orig_dn && $this->orig_dn != "new"){
+      $tmp = new acl($this->config,$this->parent,$this->dn);
+      $tmp->update_acl_membership($this->orig_dn,$this->dn);
+    }
+
     if($this->initially_was_account){
       new log("modify","groups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
index 27d617d8c674d9a829a8d2dd9b5144f534514f1e..617c7eacaff81cd72b8c8fdb35d55a22670b7b03 100644 (file)
@@ -962,8 +962,10 @@ class user extends plugin
 
     /* Remove ACL dependencies too, 
      */
-    $tmp = new acl($this->config,$this->parent,$this->dn);
-    $tmp->update_acl_membership($this->orig_dn,$this->dn);
+    if($this->dn != $this->orig_dn && $this->orig_dn != "new"){
+      $tmp = new acl($this->config,$this->parent,$this->dn);
+      $tmp->update_acl_membership($this->orig_dn,$this->dn);
+    }
 
     if($mode == "modify"){
       new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());