Code

Added logging to some services
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 May 2007 08:27:29 +0000 (08:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 May 2007 08:27:29 +0000 (08:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6382 594d385d-05f5-0310-b6e9-bd551577e9d8

13 files changed:
plugins/admin/systems/class_goImapServer.inc
plugins/admin/systems/class_goKrbServer.inc
plugins/admin/systems/class_goLdapServer.inc
plugins/admin/systems/class_goLogDBServer.inc
plugins/admin/systems/class_goMailServer.inc
plugins/admin/systems/class_goNtpServer.inc
plugins/admin/systems/class_goService.inc
plugins/admin/systems/class_goShareServer.inc
plugins/admin/systems/class_goSpamServer.inc
plugins/admin/systems/class_goSyslogServer.inc
plugins/admin/systems/class_goTerminalServer.inc
plugins/admin/systems/class_goVirusServer.inc
plugins/admin/systems/class_gosaLogServer.inc

index 8a95ed7ad854c541aa75ac12c36700dc3f7d904c..95d5d87dc3755c73eef15ac6c2f7f51db827366d 100644 (file)
@@ -45,7 +45,7 @@ class goImapServer extends goService {
  
   function goImapServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
   
     $this->DisplayName = _("IMAP/POP3 service");
 
index d753d15e26526c1b15b5fdb93a99a3fea7cfa7ee..edcc58f0f7598121ec2fbf113e955b2d0f0e1f2e 100644 (file)
@@ -26,7 +26,7 @@ class goKrbServer extends goService{
  
   function goKrbServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("Kerberos service");
   }
 
index 5bce185394f7f5c518af2a69f6660057d06b33bc..f4b2dccf23d37d42348f0ef094b71897a7c99395 100644 (file)
@@ -24,7 +24,7 @@ class goLdapServer extends goService{
 
   function goLdapServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("LDAP service");
   }
 
index 31ad8e8dc5f4246fe1f47eb21dff888a5c25995c..77ac6250c8de2288e911d0dcd2c581636f7160e1 100644 (file)
@@ -26,7 +26,7 @@ class goLogDBServer extends goService{
 
   function goLogDBServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("Logging database");
   }
 
index bb25b15bddf95ee5e814bf4ed4c0bd630665f9c2..0e28173b0aa80ac07cef411d43e74e1a5433e6eb 100644 (file)
@@ -42,7 +42,7 @@ class goMailServer extends goService{
 
   function goMailServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("Mail smtp service (Postfix)");
 
     $this->Actions = array( SERVICE_STOPPED=>SERVICE_STOPPED,
@@ -577,8 +577,10 @@ class goMailServer extends goService{
     show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/mail with dn '%s' failed."),$this->dn));
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());  
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());  
     }
 
   }
index f51f9b2118d4bde5140ed9b4cf21879eb35b1d56..d64c45d2c69a5d89446ea3e6022bc86630248d76 100644 (file)
@@ -25,7 +25,7 @@ class goNtpServer extends goService{
 
   function goNtpServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("Time service (NTP)");
 
     /* Load arrays */
@@ -93,8 +93,10 @@ class goNtpServer extends goService{
     show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/goNtpServer with dn '%s' failed."),$this->dn));
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
   }
 
index 515be0eb8a3e7a3c7acca89b29a9910d6ef827e0..a73ff751e892762570f0c65d18844a3c0f74315d 100644 (file)
@@ -112,16 +112,16 @@ class goService extends plugin{
     if($ldap->count()){
       $ldap->cd($this->dn);
       $ldap->modify($this->attrs);
-      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
-      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
     if($this->initially_was_account){
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $this->handle_post_events("modify");
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/".get_class($this)." - (".$this->DisplayName.") with dn '%s' failed."),$this->dn));
   }
index 5f580dde93e6d69bc6555e0bbb4f843506252a28..11ed781bac2a98c8a39129cd864a8cd4cf892469 100644 (file)
@@ -27,7 +27,7 @@ class goShareServer extends goService{
 
   function goShareServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
 
     $this->DisplayName = _("File service");
 
@@ -187,8 +187,10 @@ class goShareServer extends goService{
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/shares with dn '%s' failed."),$this->dn));
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
   }
 
index a5ac7fa563e126e843ca440089339dafbc39005f..a7cb30dce991777a9de423b8bfd09755a0df1f63 100644 (file)
@@ -45,7 +45,7 @@ class gospamserver extends goService{
   function gospamserver($config,$dn, $parent= NULL)
   {
     /* Init class */
-    plugin::plugin($config,$dn, $parent);
+    goService::goService($config,$dn, $parent);
     $this->DisplayName = _("Spamassassin");
 
     /* Get userinfo & acls */
@@ -270,8 +270,10 @@ class gospamserver extends goService{
     }
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/spamassassin with dn '%s' failed."),$this->dn));
index da96ea33085a730f92d14292ccc4847762c19182..382d594f0b23d736c46809b3588853629ac33d30 100644 (file)
@@ -24,7 +24,7 @@ class goSyslogServer extends goService{
  
   function goSyslogServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("Logging service");
   }
 
index fea6e77db18627047048d76b96df7fdc8c63fea4..1b1eeecf5fa72a53953d8e33f155adb93229cd9d 100644 (file)
@@ -27,7 +27,7 @@ class goTerminalServer extends goService{
 
   function goTerminalServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("Terminal service");
   }
 
@@ -78,8 +78,10 @@ class goTerminalServer extends goService{
     show_ldap_error($ldap->get_error(), sprintf(_("Saving server services/terminalServer with dn '%s' failed."),$this->dn));
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
   }
 
index 2cc0a1b1a83de33e6686ffa7f35d9aa827bc56b7..a469988f8cfde689a48031d4660db6041a38d3c1 100644 (file)
@@ -43,7 +43,7 @@ class govirusserver extends goService{
   function govirusserver($config,$dn, $parent= NULL)
   {
     /* Init class */
-    plugin::plugin($config,$dn, $parent);
+    goService::goService($config,$dn, $parent);
     $this->DisplayName = _("Anti virus");
 
     /* Get userinfo & acls */
@@ -140,8 +140,10 @@ class govirusserver extends goService{
     }
     if($this->initially_was_account){
       $this->handle_post_events("modify");
+      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
       $this->handle_post_events("add");
+      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of server services/anti virus with dn '%s' failed."),$this->dn));
index 51288754eba0451a2717fd22dba02eb3fe885f12..8bd11cc1b3e148616c4339927deb1b360d15ba61 100644 (file)
@@ -23,7 +23,7 @@ class gosaLogServer extends goService{
 
   function gosaLogServer($config,$dn)
   {
-    plugin::plugin($config,$dn);
+    goService::goService($config,$dn);
     $this->DisplayName = _("GOsa logging service");
   }