Code

Fixed logging
[gosa.git] / include / class_acl.inc
index 4e94b40c44e124e0d50289c436f86f36ea955cb4..99adff3fc05ddffe0743a1e93b897eebe06de24d 100644 (file)
@@ -50,7 +50,7 @@ class acl extends plugin
     $this->parent= $parent;
 
     /* Container? */
-    if (preg_match('/^(ou|c|l|dc)=/i', $dn)){
+    if (preg_match('/^(o|ou|c|l|dc)=/i', $dn)){
       $this->isContainer= TRUE;
     }
 
@@ -1032,6 +1032,8 @@ class acl extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs);
 
+    @log::log("modify","acls/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
     show_ldap_error($ldap->get_error(), sprintf(_("Saving ACLs with dn '%s' failed."),$this->dn));
 
     /* Refresh users ACLs */
@@ -1043,6 +1045,19 @@ class acl extends plugin
 
   function remove_from_parent()
   {
+    plugin::remove_from_parent();
+
+    /* include global link_info */
+    $ldap= $this->config->get_ldap_link();
+
+    $ldap->cd($this->dn);
+    $this->cleanup();
+    $ldap->modify ($this->attrs);
+
+    @log::log("remove","acls/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+    /* Optionally execute a command after we're done */
+    $this->handle_post_events("remove",array("uid" => $this->uid));
   }
 
 }