Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_servKolab.inc
index 3b666fd43bbae9848f4ebb8cfcc630909d4d4c81..7768f2563998017301e02eb4e41fc2663ae54574 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once("class_goService.inc");
-
 class servkolab extends goService {
   /* CLI vars */
   var $cli_summary = "Manage server basic objects";
@@ -20,15 +18,16 @@ class servkolab extends goService {
   var $kolabFreeBusyFuture              = "1";
   var $k                                = "kolab";
   var $cyrus_imap                       = "TRUE";
-  var $cyrus_pop3                       = "TRUE";
+  var $cyrus_pop3                       = "FALSE";
   var $cyrus_imaps                      = "TRUE";
   var $cyrus_pop3s                      = "TRUE";
   var $cyrus_sieve                      = "TRUE";
   var $apache_allow_unauthenticated_fb  = "TRUE";
-  var $proftpd_ftp                      = "TRUE";
+  var $proftpd_ftp                      = "FALSE";
   var $apache_http                      = "TRUE";
   var $kolabHost                        = array();
   var $orig_cn                          = "";
+  var $view_logged                      = FALSE;
 
   var $attributes =  array("postfix_mydomain", "postfix_mydestination", "proftpd_ftp", "k",
       "postfix_mynetworks", "postfix_enable_virus_scan", "postfix_relayhost", "apache_http",
@@ -42,7 +41,7 @@ class servkolab extends goService {
   var $DisplayName  = "Kolab mail service";
   var $StatusFlag   = "";
 
-  function servkolab($config, $dn = NULL, $parent= NULL) 
+  function servkolab(&$config, $dn = NULL, $parent= NULL) 
   {
     /* Setting the hostname and tell this Plugin that we are the kolab extension*/
     $this->hostname = preg_replace('/^cn=([^,]+),.*$/', '\1', $dn);
@@ -76,10 +75,6 @@ class servkolab extends goService {
         $this->initially_was_account = true;
       }
     } 
-
-    if($this->is_account){
-      @log::log("view","server/".get_class($this),$this->dn);
-    }
   }
 
 
@@ -88,6 +83,11 @@ class servkolab extends goService {
     /* Call parent execute */
     plugin::execute();
 
+    if($this->is_account && !$this->view_logged){
+      $this->view_logged = TRUE;
+      new log("view","server/".get_class($this),$this->dn);
+    }
+
     /***************  
       Variable initialisation
      ***************/  
@@ -180,7 +180,7 @@ class servkolab extends goService {
       return;
     }
 
-    /* Integration check, not translatet because they can't pop up at all, only for debug */ 
+    /* Integration check, not translated because they can't pop up at all, only for debug */ 
     if(count($this->kolabHost) == 0){
       print_red("Server - Kolab tab : This is not possible, we can't remove an account which doesn't exists.");
       return;
@@ -196,8 +196,6 @@ class servkolab extends goService {
       /* Remove complete entry */
       $ldap->rmdir ($this->dn);
       show_ldap_error($ldap->get_error(), sprintf(_("Removing host entry from system server/kolab with dn '%s' failed."),$this->dn));
-      gosa_log("k=kolab entry removed, ".$this->hostname." was the last kolabHost entry.");
-
     } else {
 
       /* Only modify kolabHost */
@@ -212,10 +210,9 @@ class servkolab extends goService {
       $this->cleanup();
       $ldap->modify ($attrs); 
       show_ldap_error($ldap->get_error(), sprintf(_("Removing host entry from system server/kolab with dn '%s' failed."),$this->dn));
-      gosa_log("Removing ".$this->hostname." from list of kolabHosts");
     }
 
-    @log::log("remove","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    new log("remove","server/".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");
@@ -352,9 +349,9 @@ class servkolab extends goService {
     $ldap->$mode($this->attrs);
 
     if($mode == "add"){
-      @log::log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
-      @log::log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("modify","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
     show_ldap_error($ldap->get_error(), sprintf(_("Saving system server/kolab with dn '%s' failed."),$this->dn));