Code

Added gofon logging
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 09:51:59 +0000 (09:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 May 2007 09:51:59 +0000 (09:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6416 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/conference/class_phoneConferenceGeneric.inc
plugins/gofon/fonreports/class_fonreport.inc
plugins/gofon/macro/class_gofonMacro.inc
plugins/gofon/phoneaccount/class_phoneAccount.inc

index 057401432d6930e29298372110be12abed867c68..50795e6a03d0356356e36d0ecfdbeaf824ee5434 100644 (file)
@@ -52,7 +52,7 @@ class conference extends plugin
   /* Headpage attributes */
   var $last_dep_sorting= "invalid";
   var $departments= array();
-
+  var $view_logged = FALSE;
   var $dialog ;
 
   /* attribute list for save action */
@@ -148,6 +148,12 @@ class conference extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    /* Log last action */
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","gofonconference/".get_class($this),$this->dn);
+    }
+
     $smarty= get_smarty();
 
     $smarty->assign("bases" ,$this->config->idepartments);
@@ -250,6 +256,8 @@ class conference extends plugin
     $ldap->cd ($this->dn);
     $ldap->recursive_remove();
 
+    @log::log("remove","gofonconference/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
     /* Optionally execute a command after we're done */
     $this->handle_post_events('remove');
   }
@@ -660,6 +668,14 @@ class conference extends plugin
       $ldap->add($this->attrs);
       $this->handle_post_events('add');
     }
+
+    /* Log last action */
+    if($this->initially_was_account){
+      @log::log("modify","gofonconference/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    }else{
+      @log::log("create","gofonconference/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    }
+
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of goFonConference/generic with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index 69abf97f4b9f564dbb716c2c22278be361cda758..7c58872b430eb0a5fd8e17a31a5de6f0a705cf33 100644 (file)
@@ -24,7 +24,7 @@ class fonreport extends plugin
   /* attribute list for save action */
   var $attributes_SO  = array("start","search_for","search_base","range","month","sort_direction","sort","year");
   var $objectclasses  = array();
-
+  var $view_logged = FALSE;
   
   /* Construct class */
   function fonreport ($config, $ui)
@@ -104,6 +104,11 @@ class fonreport extends plugin
     /* GVet template engine */
     $smarty= get_smarty();
 
+    /* Log view */
+    if(!$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","gofon/".get_class($this),$this->dn);
+    }
 
     /*****************
       Variable Init
index cbcc99951847697a8b1deb00120706badb92f206..213cf62563ab4d989ee1fd0ac45a02ec26530ddb 100755 (executable)
@@ -42,7 +42,7 @@ class macro extends plugin
 
   /*! attribute list for save action */
   var $attributes     = array("cn","base", "description","displayName","goFonMacroContent","goFonMacroVisible");
-
+  var $view_logged = FALSE;
   var $orig_cn = ""; 
   /*! Objectclasses that this calls handles */
   var $objectclasses  = array("top", "goFonMacro");
@@ -97,6 +97,12 @@ class macro extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    /* Log view */
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","gofonmacro/".get_class($this),$this->dn);
+    }
+
     /* Variables */
     $vars      = "";
     $tmp       = array();
@@ -482,7 +488,8 @@ class macro extends plugin
     }
 
     /* Remove phone macro */ 
-    $ldap->rmDir($this->dn); 
+    $ldap->rmDir($this->dn);
+    @log::log("remove","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); 
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of goFonMacro/generic account with dn '%s' failed."),$this->dn));
 
     /* Delete references to object groups */
@@ -527,6 +534,13 @@ class macro extends plugin
         $this->handle_post_events("add");
       }
       show_ldap_error($ldap->get_error(), sprintf(_("Saving of goFonMacro/generic account with dn '%s' failed."),$this->dn));
+
+      /* Log last action */
+      if($this->initially_was_account){
+        @log::log("modify","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      }else{
+        @log::log("create","gofonmacro/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      }
     }
   }
 
index a92672422ac42e8b202f789cd8d7a2a308fe2c15..25e1f2382dd1894ce7d5a1a6da470d408da77b78 100644 (file)
@@ -46,6 +46,8 @@ class phoneAccount extends plugin
 
   var $uid;
 
+  var $view_logged = FALSE;
+
   function phoneAccount ($config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);
@@ -788,10 +790,14 @@ class phoneAccount extends plugin
     /* Call parent execute */
     plugin::execute();
 
-    $display = "";
+    /* Log view */
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
 
+    $display = "";
     $SkipWrite = (!isset($this->parent) || !$this->parent) && !isset($_SESSION['edit']);
-
     if(empty($this->macro)&&(!empty($this->goFonMacro))){
 
       /* Go through already saved values, for a parameter */
@@ -1230,6 +1236,13 @@ class phoneAccount extends plugin
     $this->attrs['telephoneNumber'] =$tmp_numbers;
     $ldap->modify ($this->attrs); 
 
+    /* Log last action */
+    if($this->initially_was_account){
+      @log::log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    }else{
+      @log::log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    }
+
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/phone account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -1367,6 +1380,7 @@ class phoneAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    @log::log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/phone account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */