Code

Added logging to complete
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 May 2007 08:16:46 +0000 (08:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 May 2007 08:16:46 +0000 (08:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6364 594d385d-05f5-0310-b6e9-bd551577e9d8

17 files changed:
plugins/personal/connectivity/class_intranetAccount.inc
plugins/personal/connectivity/class_kolabAccount.inc
plugins/personal/connectivity/class_opengwAccount.inc
plugins/personal/connectivity/class_oxchangeAccount.inc
plugins/personal/connectivity/class_phpgwAccount.inc
plugins/personal/connectivity/class_phpscheduleitAccount.inc
plugins/personal/connectivity/class_pptpAccount.inc
plugins/personal/connectivity/class_proxyAccount.inc
plugins/personal/connectivity/class_pureftpdAccount.inc
plugins/personal/connectivity/class_webdavAccount.inc
plugins/personal/environment/class_environment.inc
plugins/personal/generic/class_user.inc
plugins/personal/mail/class_mailAccount.inc
plugins/personal/nagios/class_nagiosAccount.inc
plugins/personal/netatalk/class_netatalk.inc
plugins/personal/posix/class_posixAccount.inc
plugins/personal/samba/class_sambaAccount.inc

index 367903914b48dcc1a2445b0c0c138e08ae12fd23..845ab01bba14c2c3ccfad045d045959760c4808a 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+
+
 /*!
   \author  Harald Falk <hf@doellken-weimar.de>
   \version 1.00
@@ -35,10 +37,15 @@ class intranetAccount extends plugin
   {
     plugin::plugin ($config, $dn,$parent);
 
-     /* Setting uid to default */
-     if(isset($this->attrs['uid'][0])){
-       $this->uid = $this->attrs['uid'][0];
-     }
+    /* Setting uid to default */
+    if(isset($this->attrs['uid'][0])){
+      $this->uid = $this->attrs['uid'][0];
+    }
+
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   /*!
@@ -105,6 +112,9 @@ class intranetAccount extends plugin
       $this->cleanup();
       $ldap->modify ($this->attrs); 
 
+      /* Log last action */
+      @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/intranet account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
@@ -163,6 +173,13 @@ class intranetAccount extends plugin
       $this->cleanup();
       $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/intranet account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
index b038cd9c741eb47eef94e9a951e01b4d75387c66..0b09fdc51c1136b1d1bc682f653c08c9e18702ba 100644 (file)
@@ -68,6 +68,11 @@ class kolabAccount extends plugin
        $this->is_account  = false;
       $this->mail_Account = false;
     }
+
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
 
@@ -285,6 +290,9 @@ class kolabAccount extends plugin
     $ldap->cd ($this->dn);
     $ldap->modify($this->attrs);
 
+    /* Log last action */
+    @log::log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
     $this->handle_post_events('remove',array("uid" => $this->uid));
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/kolab account with dn '%s' failed."),$this->dn));
   }
@@ -408,6 +416,13 @@ class kolabAccount extends plugin
     $this->cleanup();
     $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/kolab account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index 5f6058e5a1071e4271285d1955b394acc5d21f5e..9be419d929064e03aef707348a0c530387a97600 100644 (file)
@@ -118,6 +118,12 @@ class opengwAccount extends plugin
                        /* Transmit data back to ogw handle */
                        $this->handle->SetInfos($this->info);
                }
+
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
+
        }
 
        function execute()
@@ -225,6 +231,8 @@ class opengwAccount extends plugin
                        $this->handle = new ogw($this->serverCon['LOGIN'],$this->serverCon['PASSWORD'],$this->serverCon['SERVER'],$this->serverCon['DB']);
                        $this->handle->SetInfos($this->info);
                        $this->handle->Perform("REMOVE");
+
+      @log::log("remove","users/".get_class($this),$this->dn);
                }
        }
 
@@ -290,8 +298,10 @@ class opengwAccount extends plugin
                $this->handle->checkInfos();
                if($this->initialy_was_account){
                        $this->handle->Perform("EDIT");
+      @log::log("modify","users/".get_class($this),$this->dn);
                }else{
                        $this->handle->Perform("ADD");
+      @log::log("create","users/".get_class($this),$this->dn);
                }
        }
 
index ca660a8ac85cda41843b7b83892a7c0e35af011d..7445985a2e1c1575862b75685b4d925ec4fc7cef 100644 (file)
@@ -598,6 +598,12 @@ class oxchangeAccount extends plugin
     if(isset($this->attrs[$this->dnmode][0])){
       $this->dnModeValue = $this->attrs[$this->dnmode][0];
     }
+
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
+
   }
 
   function execute()
@@ -739,6 +745,9 @@ class oxchangeAccount extends plugin
         $this->attributes, "Save");
     $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/oxchange addressbook account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -842,6 +851,12 @@ class oxchangeAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    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/oxchange account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index ce14d589c42da20310a3d829a7dd8e2af64cd991..4a1745f43b6b0bdbec3451bdd050221f76768971 100644 (file)
@@ -26,6 +26,10 @@ class phpgwAccount extends plugin
       $this->uid = $this->attrs['uid'][0];
     }
 
+
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -78,6 +82,8 @@ class phpgwAccount extends plugin
 
       show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPgw account with dn '%s' failed."),$this->dn));
 
+      @log::log("remove","users/".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',array("uid" => $this->uid));
     }
@@ -122,6 +128,12 @@ class phpgwAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    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/PHPgw account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -132,6 +144,7 @@ class phpgwAccount extends plugin
     } else {
       $this->handle_post_events("add",array("uid" => $this->uid));
     }
+
   }
 
 
index a744b2dae4b8a221dcb1848a73ea2ca847e94371..56cd7fc7853994afff3709bc5b5013e7390b4d09 100644 (file)
@@ -35,6 +35,10 @@ class phpscheduleitAccount extends plugin
   function phpscheduleitAccount ($config, $dn= NULL)
   {
     plugin::plugin ($config, $dn);
+
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -77,6 +81,9 @@ class phpscheduleitAccount extends plugin
       $ldap->modify ($this->attrs); 
       show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/PHPscheduleit account with dn '%s' failed."),$this->dn));
 
+      if($this->is_account){
+        @log::log("remove","users/".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',array("uid" => $this->uid));
     }
@@ -121,6 +128,12 @@ class phpscheduleitAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    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/PHPscheduleit account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index 96c8dea6c30954ae0a10c37a7efffa671b251922..3a0e15f60049d9f6c2867665778cda6227f54016 100644 (file)
@@ -43,6 +43,11 @@ class pptpAccount extends plugin
       $this->uid = $this->attrs['uid'][0];
     }
 
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
+
   }
 
   function execute()
@@ -90,6 +95,9 @@ class pptpAccount extends plugin
       $this->cleanup();
       $ldap->modify ($this->attrs); 
 
+      /* Log last action */
+      @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/PPTP account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
@@ -137,6 +145,13 @@ class pptpAccount extends plugin
       $this->cleanup();
       $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/PPTP account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
index dbb0f79354fa5d85bfd137e525b8959b54a63d69..497166060ba5552bc8815ab2af2c3b52425299f6 100644 (file)
@@ -31,6 +31,10 @@ class proxyAccount extends plugin
       $this->uid = $this->attrs['uid'][0];
     }
 
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -155,6 +159,9 @@ class proxyAccount extends plugin
       $this->cleanup();
       $ldap->modify ($this->attrs); 
 
+      /* Log last action */
+      @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/proxy account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
@@ -270,6 +277,13 @@ class proxyAccount extends plugin
     $this->cleanup();
     $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/proxy account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
index 1069f60c91062d202626a348f834659249aa2ed5..b9abfbf64627ebb253ffcf7975593a4ad09c3476 100644 (file)
@@ -34,6 +34,10 @@ class pureftpdAccount extends plugin
       $this->uid = $this->attrs['uid'][0];
     }
 
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -104,6 +108,9 @@ class pureftpdAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    /* Log last action */
+    @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/pureftpd account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -195,6 +202,13 @@ class pureftpdAccount extends plugin
     $ldap->cd($this->dn);
     $this->cleanup();
     $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/pureftpd account with dn '%s' failed."),$this->dn));
 
index dfc9352be5122e93666683c24e294dfd8e062e18..de2202873054b51f862e7a0da7a39eb9e7d34de3 100644 (file)
@@ -22,6 +22,10 @@ class webdavAccount extends plugin
       $this->uid = $this->attrs['uid'][0];
     }
 
+    /* Log view */
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -73,6 +77,9 @@ class webdavAccount extends plugin
       $this->cleanup();
       $ldap->modify ($this->attrs); 
 
+      /* Log last action */
+      @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/webDAV account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
@@ -120,6 +127,13 @@ class webdavAccount extends plugin
       $this->cleanup();
       $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/webDAV account with dn '%s' failed."),$this->dn));
 
       /* Optionally execute a command after we're done */
index 0f3d93059edbc5011c79b74757ac1017b77190bb..f8ad1f0b1127c2654d30b16d5112bbec8519d13a 100644 (file)
@@ -1193,7 +1193,8 @@ class environment extends plugin
     $this->cleanup();
     $ldap->$mode($this->attrs);
 
-    if($mode == "modify"){
+    /* Log last action */ 
+    if($this->initially_was_account){
       @log::log("modify","users/environment",$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       @log::log("create","users/environment",$this->dn,array_keys($this->attrs),$ldap->get_error());
index 71e11b99f5316cc869345ee577cebd776844686a..193143566ae7c5e6f0044577c117f58a0e16b527 100644 (file)
@@ -137,7 +137,7 @@ class user extends plugin
     if ($dn == "new"){
       $this->is_account= TRUE;
     }else{
-      @log::log("view","users/user",$dn);
+      @log::log("view","users/".get_class($this),$this->dn);
     }
 
     /* Make hash default to md5 if not set in config */
@@ -592,7 +592,7 @@ class user extends plugin
     $ldap->rmdir ($this->dn);
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/generic account with dn '%s' failed."),$this->dn));
   
-    @log::log("remove","users/user",$dn,$this->attributes,$ldap->get_error());
+    @log::log("remove","users/".get_class($this),$this->dn,$this->attributes,$ldap->get_error());
   
     /* Delete references to groups */
     $ldap->cd ($this->config->current['BASE']);
@@ -944,9 +944,9 @@ class user extends plugin
     }
 
     if($mode == "modify"){
-      @log::log("modify","users/user",$this->dn,array_keys($this->attrs),$ldap->get_error());
+      @log::log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
-      @log::log("create","users/user",$this->dn,array_keys($this->attrs),$ldap->get_error());
+      @log::log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
     /* Remove cert? 
index 9c5dfddc9c62cb4e3150ff09e5926ffc7c7710ec..0221fd4e0e95bce8ffb3dc0a79b7238f2f0e888f 100644 (file)
@@ -198,6 +198,11 @@ class mailAccount extends plugin
           "regex"           => "*");
       register_global("mailfilter", $mailfilter);
     }
+   
+    /* Add "view" to logging class */ 
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
 
@@ -675,6 +680,9 @@ class mailAccount extends plugin
 
     $ldap->modify ($this->attrs); 
 
+    /* Add "view" to logging class */ 
+    @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/mail account with dn '%s' failed."),$this->dn));
 
     /* Connect to IMAP server for account deletion */
@@ -831,6 +839,13 @@ class mailAccount extends plugin
 
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/mail account with dn '%s' failed."),$this->dn));
 
+    /* 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());
+    }
+
     /* Only do IMAP actions if we are not a template */
     if (!$this->is_template){
 
index 9f32138a1021369a527ee56b28d77a008e6cc21f..0e0a09d478218af554cdb8902ad0b383a49b28b1 100644 (file)
@@ -77,6 +77,10 @@ class nagiosAccount extends plugin
 
     /* Save initial account state */  
     $this->initially_was_account= $this->is_account;
+
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -161,6 +165,13 @@ class nagiosAccount extends plugin
     $this->cleanup();
     $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/nagios account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -242,6 +253,8 @@ class nagiosAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    @log::log("view","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/nagios account with dn '%s' failed."),$this->dn));
 
     /* remove the entry from LDAP */
index 1d06faac49c81968c6b56a138208819cdbe65b48..4d772a8c263f71912cc122c348a05332a13af671 100644 (file)
@@ -102,6 +102,10 @@ class netatalk extends plugin {
 
     /* Save initial account state */
     $this->initially_was_account = $this->is_account;
+
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
 
@@ -278,6 +282,12 @@ class netatalk extends plugin {
     $this->cleanup();
     $ldap->modify($this->attrs);
 
+    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/netatalk account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -338,6 +348,8 @@ class netatalk 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/netatalk account with dn '%s' failed."),$this->dn));
 
     /* remove the entry from LDAP */
index 4dece52c5e6bcec4366630c972fb3a61207c855c..f8068ce63bbfeb75597bddc1eec5b8206d028c69 100644 (file)
@@ -97,7 +97,7 @@ class posixAccount extends plugin
     $ldap= $this->config->get_ldap_link();
 
     if($this->is_account){
-      @log::log("view","users/posix",$this->dn);
+      @log::log("view","users/".get_class($this),$this->dn);
     }
 
     if ($dn != NULL){
@@ -615,7 +615,7 @@ class posixAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
-    @log::log("remove","users/posix",$this->dn,array_keys($this->attrs),$ldap->get_error());
+    @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/posix account with dn '%s' failed."),$this->dn));
 
@@ -854,7 +854,12 @@ class posixAccount extends plugin
     unset($this->attrs['uid']);
     $ldap->modify ($this->attrs); 
 
-    @log::log("modify","users/posix",$this->dn,array_keys($this->attrs),$ldap->get_error());
+    /* 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/posix account with dn '%s' failed."),$this->dn));
 
index 879f4e6ba5a6d76b1a66e747ad0c8b901e839049..c9b2667191557bf5ce81eed38956ff59405cac66 100644 (file)
@@ -188,6 +188,10 @@ class sambaAccount extends plugin
 
     /* Save initial account state */
     $this->initially_was_account= $this->is_account;
+
+    if($this->is_account){
+      @log::log("view","users/".get_class($this),$this->dn);
+    }
   }
 
   function execute()
@@ -662,6 +666,8 @@ class sambaAccount 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/samba account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */
@@ -1010,6 +1016,12 @@ class sambaAccount extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
+    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/samba account with dn '%s' failed."),$this->dn));
 
     /* Optionally execute a command after we're done */