Code

Switched log call
[gosa.git] / plugins / admin / systems / class_goService.inc
index a73ff751e892762570f0c65d18844a3c0f74315d..49c44125f615eb26c5d9677eba050c8118f3eab1 100644 (file)
@@ -16,6 +16,7 @@ class goService extends plugin{
   var $dn                   = NULL;
   var $cn                   = "";
   var $DisplayName          = "";
+  var $view_logged  =FALSE;
 
    
   /* Construcktion */ 
@@ -23,16 +24,17 @@ class goService extends plugin{
   {
     plugin::plugin($config,$dn);
     $this->DisplayName = _("Empty service");
-
-    if($this->is_account){
-      @log::log("view","server/".get_class($this),$this->dn);
-    }
   }
 
   
   /* Create content */
   function execute()
   {
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+
     $str ="<div style='width:100%; text-align:right;'>".
           "  <input type='submit' name='SaveService' value='"._("Save")."'>&nbsp;".
           "  <input type='submit' name='CancelService' value='"._("Cancel")."'>".
@@ -95,7 +97,7 @@ class goService extends plugin{
       
     }
 
-    @log::log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    new log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of server services/".get_class($this)." - (".$this->DisplayName.") with dn '%s' failed."),$this->dn));
     $this->handle_post_events("remove");
@@ -117,11 +119,11 @@ class goService extends plugin{
       $ldap->add($this->attrs);
     }
     if($this->initially_was_account){
-      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $this->handle_post_events("modify");
     }else{
       $this->handle_post_events("add");
-      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/".get_class($this)." - (".$this->DisplayName.") with dn '%s' failed."),$this->dn));
   }