Code

Added logging to apps
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 May 2007 13:05:59 +0000 (13:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 May 2007 13:05:59 +0000 (13:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6387 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/applications/class_applicationGeneric.inc

index a18a27e08131fcafe62194b3f2e8f22a08221084..5ecab3a94495d85905ba0af1a94ea12f9717e4ca 100644 (file)
@@ -70,10 +70,15 @@ class application extends plugin
         $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
       }
     }
+      
+    if($this->is_account && $dn != "new"){
+      @log::log("view","application/".get_class($this),$this->dn);
+    }
   }
 
 
-  function generateTemplate(){
+  function generateTemplate()
+  {
     $str= "# This code is part of GOsa (https://gosa.gonicus.de)\n#\n";
 
     $values = array();
@@ -224,6 +229,7 @@ class application extends plugin
   {
     $ldap= $this->config->get_ldap_link();
     $ldap->rmDir($this->dn);
+    @log::log("remove","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of application with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -450,6 +456,7 @@ class application extends plugin
       $this->cleanup();
       $ldap->modify ($this->attrs); 
       $this->handle_post_events("modify");
+      @log::log("modify","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     } else {
       
       /* Remove gotoLogonScript if it is empty */
@@ -461,6 +468,7 @@ class application extends plugin
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
+      @log::log("create","application/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $this->handle_post_events("add");
     }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of application with dn '%s' failed."),$this->dn));