Code

Added Log to glpi extension
[gosa.git] / plugins / admin / systems / class_componentGeneric.inc
index 2e6f7029814a0d49e6628220ee64de668b5fb49d..be0a560125f0c3640cc1686b7b5b4c76c3b2b43c 100644 (file)
@@ -37,6 +37,10 @@ class componentGeneric extends plugin
     $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true);
     /* Save dn for later references */
     $this->orig_dn= $this->dn;
+
+    if($this->is_account){
+      @log::log("view","component/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -122,6 +126,9 @@ class componentGeneric extends plugin
     $ldap= $this->config->get_ldap_link();
     $this->netConfigDNS->remove_from_parent();
     $ldap->rmdir($this->dn);
+    
+    @log::log("remove","component/".get_class($this),$this->dn,$this->attributes,$ldap->get_error());
+
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of system component/generic with dn '%s' failed."),$this->dn));
     $this->handle_post_events("remove");
 
@@ -230,7 +237,9 @@ class componentGeneric extends plugin
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
+      @log::log("create","component/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $this->handle_post_events("add");
+      
     } else {
       if ($this->orig_dn != $this->dn){
         $this->move($this->orig_dn, $this->dn);
@@ -239,7 +248,7 @@ class componentGeneric extends plugin
       $ldap->cd($this->dn);
       $this->cleanup();
       $ldap->modify ($this->attrs); 
-
+      @log::log("modify","component/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $this->handle_post_events("modify");
     }