Code

Enabled single cut and paste
[gosa.git] / plugins / admin / ogroups / class_mailogroup.inc
index 7ffe77da6a51dcefd57e6dddbdb62ee81db170fd..1040dc626a0269fb76e3709574f24860acc9f09f 100644 (file)
@@ -10,7 +10,7 @@ class mailogroup extends plugin
   var $attributes= array("mail");
   var $objectclasses= array("kolabGroupOfNames");
   var $members= array();
-
+  var $view_logged = FALSE;
 
   function mailogroup ($config, $dn= NULL, $parent= NULL)
   {
@@ -21,10 +21,6 @@ class mailogroup extends plugin
 
     /* Save initial account state */
     $this->initially_was_account= $this->is_account;
-    
-    if($this->is_account){
-      @log::log("view","ogroups/".get_class($this),$this->dn);
-    }
   }
 
 
@@ -33,6 +29,12 @@ class mailogroup extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","ogroups/".get_class($this),$this->dn);
+    }
+
+
     /* Do we need to flip is_account state? */
     if(isset($_POST['modify_state'])){
       if($this->is_account && $this->acl_is_removeable()){
@@ -108,9 +110,9 @@ class mailogroup extends plugin
     $ldap->modify ($this->attrs); 
 
     if($this->initially_was_account){
-      @log::log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
-      @log::log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of object group/mail with dn '%s' failed."),$this->dn));
@@ -146,7 +148,7 @@ class mailogroup extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
-    @log::log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of object group/mail with dn '%s' failed."),$this->dn));
   }