Code

Added sorting to FAIscripts
[gosa.git] / plugins / admin / fai / class_faiProfile.inc
index 568d120f2b3e55c9da471de7ae8284cba3cc6a43..f7ec6810c13d5504306cd059b7a515dd3c2d5828 100644 (file)
@@ -27,6 +27,7 @@ class faiProfile extends plugin
   var $FAIAllclasses    = array();  // Contains all possible Classnames
   var $ui               ;
   var $FAIstate      = "";
+  var $view_logged      = FALSE;
 
   function faiProfile($config, $dn= NULL)
   {
@@ -204,6 +205,12 @@ class faiProfile extends plugin
   {
     /* Call parent execute */
     plugin::execute();
+
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","fai/".get_class($this),$this->dn);
+    }
+
     /* Fill templating stuff */
     $smarty= get_smarty();
     $display= "";
@@ -369,6 +376,7 @@ class faiProfile extends plugin
       $use_dn = $this->dn;
     }
 
+    new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
     prepare_to_save_FAI_object($use_dn,array(),true);
     $this->handle_post_events("remove");    
   }
@@ -427,7 +435,13 @@ class faiProfile extends plugin
     $this->attrs['FAIclass']=trim($this->FAIclass);
 
     prepare_to_save_FAI_object($this->dn,$this->attrs);
-    
+   
+    if($this->initially_was_account){
+      new log("modify","fai/".get_class($this),$this->dn,$this->attributes);
+    }else{
+      new log("create","fai/".get_class($this),$this->dn,$this->attributes);
+    }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/profile with dn '%s' failed."),$this->dn));
 
     /* Do object tagging */