Code

updated logging
[gosa.git] / plugins / admin / ogroups / class_termgroup.inc
index ece1d495c816a8d60e109106b9ecb940645fb0ea..a05c6a1c0de4fbb3195d818ada9e9cd70fd6ec28 100644 (file)
@@ -25,6 +25,8 @@ class termgroup extends plugin
   var $attributes     = array("gotoMode","gotoSyslogServer", "gotoNtpServer");
   var $objectclasses  = array("gotoWorkstationTemplate");
   var $CopyPasteVars  = array("gotoNtpServers","modes","inheritTimeServer","members");
+  var $view_logged    = FALSE;
+
 
   function termgroup ($config, $dn= NULL, $parent= NULL)
   {
@@ -95,10 +97,6 @@ class termgroup extends plugin
         unset($this->gotoNtpServers[$key]);
       }
     }
-
-    if($this->is_account){
-      @log::log("view","ogroups/".get_class($this),$this->dn);
-    }
   }
 
   function check()
@@ -168,12 +166,6 @@ class termgroup extends plugin
         $ldap->cd ($key);
         $ldap->modify($attrs);
         show_ldap_error($ldap->get_error(),sprintf(_("Setting action state (FAIstate) failed for object '%s', value was '%s'."),$key,$action));
-        
-        if(!preg_match("/success/i",$ldap->get_error())) {
-          gosa_log("FAILED !! Updating FAIstate to '".$action."' : ".$key);
-        }else{
-          gosa_log("OK.  Updating FAIstate to '".$action."' : ".$key);
-        }
       }
     }
   }
@@ -183,6 +175,10 @@ class termgroup extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    if(!$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","ogroups/".get_class($this),$this->dn);
+    }
 
     /*************** 
       Handle requested action