Code

Updated workstation - Startup
[gosa.git] / plugins / admin / systems / class_servKolab.inc
index 7ca2e1d700a49d6914bee9125b0570f68e24c76c..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";
@@ -9,6 +7,7 @@ class servkolab extends goService {
   var $cli_parameters = array("eins"=>"Eins ist toll", "zwei"=>"Zwei ist noch besser");
 
   var $postfix_mydomain                 = "";
+  var $cyrus_admins                     = "";
   var $postfix_mydestination            = "";
   var $postfix_mynetworks               = "127.0.0.1/8";
   var $postfix_enable_virus_scan        = "TRUE";
@@ -18,17 +17,17 @@ class servkolab extends goService {
   var $cyrus_quotawarn                  = "80";
   var $kolabFreeBusyFuture              = "1";
   var $k                                = "kolab";
-  var $cyrus_admins                     = "TRUE";
   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,14 +41,14 @@ 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);
     $this->dn       = "k=kolab,".$config->current['BASE'];
 
     /* Load variables, if given*/
-    plugin::plugin($config, $this->dn, $parent);
+    plugin::plugin($config, $this->dn);
 
     /* Copy needed attributes */
     foreach($this->attributes as $val) {
@@ -76,7 +75,6 @@ class servkolab extends goService {
         $this->initially_was_account = true;
       }
     } 
-
   }
 
 
@@ -85,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
      ***************/  
@@ -177,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;
@@ -193,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 */
@@ -209,9 +210,10 @@ 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");
     }
 
+    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");
   }
@@ -231,7 +233,7 @@ class servkolab extends goService {
 
       /* Save checkboxes */
       foreach (array( "postfix_enable_virus_scan", "postfix_allow_unauthenticated",
-            "cyrus_admins", "cyrus_imap", "cyrus_pop3", "cyrus_imaps",
+            "cyrus_imap", "cyrus_pop3", "cyrus_imaps",
             "cyrus_pop3s", "cyrus_sieve", "apache_allow_unauthenticated_fb",
             "proftpd_ftp", "apache_http") as $cb){
 
@@ -345,6 +347,13 @@ class servkolab extends goService {
     $ldap->cd($this->dn);
     $this->cleanup();;
     $ldap->$mode($this->attrs);
+
+    if($mode == "add"){
+      new log("create","server/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    }else{
+      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));
 
     /* Optionally execute a command after we're done */
@@ -382,6 +391,7 @@ class servkolab extends goService {
           "plProvidedAcls"=> array(
             "postfixmydomain"                => _("Postfix mydomain") ,
             "postfixmydestination"           => _("My destination") ,
+            "cyrusadmins"                    => _("Cyrus admins") ,
             "proftpdftp"                     => _("FTP FreeBusy service") ,
             "postfixmynetworks"              => _("SMTP privileged networks") ,
             "postfixenablevirusscan"         => _("Enable virus scan") ,