Code

update
[gosa.git] / plugins / admin / systems / class_servService.inc
index 850a9551550e61b9f2ae218bd37b010e3bdb3c7f..627cb5a95d82761ebcf50177a666ad19dcb18892 100644 (file)
@@ -13,24 +13,26 @@ class servservice extends plugin
   var $goXdmcpIsEnabled = "";
   var $goFontPath       = "";
   var $goNTPServer      = "";
-  var $goShareServer      = "";
+  var $goShareServer    = false;
   var $goLdapServer     = "";
   var $goTerminalServer = "";
   var $goSyslogServer   = "";
   var $goCupsServer     = "";
+  var $goMailServer     = "";
   var $o_subWindow      = NULL;
 
   /* attribute list for save action */
   var $ignore_account= TRUE;
   var $attributes       = array("goLdapBase","goXdmcpIsEnabled","goFontPath");
   var $possible_objectclasses= array( "goShareServer", "goNtpServer", "goServer", "goLdapServer",
-                                      "goTerminalServer", "goSyslogServer", "goCupsServer");
+                                      "goTerminalServer", "goSyslogServer", "goCupsServer","goMailServer");
   var $objectclasses    = array( "top","goServer"); 
   var $additionaloc     = array( "goShareServer"     => array("goExportEntry"),
                                  "goNtpServer"     => array("goTimeSource"),
                                  "goLdapServer"    => array("goLdapBase"),
                                  "goTerminalServer"=> array("goXdmcpIsEnabled", "goFontPath"),
                                  "goSyslogServer"  => array(),
+                                 "goMailServer"    => array(),
                                  "goCupsServer"    => array());
 
   function servservice ($config, $dn= NULL)
@@ -57,17 +59,26 @@ class servservice extends plugin
 
     $tmp =array();
     $tmp2=array();
-    unset($this->attrs['goExportEntry']['count']);
-    if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){
-      foreach($this->attrs['goExportEntry'] as $entry){
-        $tmp2= split("\|",$entry);
-        $tmp[$tmp2[0]]= $entry;
+    if(isset($this->attrs['goExportEntry'])){
+      unset($this->attrs['goExportEntry']['count']);
+      if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){
+        foreach($this->attrs['goExportEntry'] as $entry){
+          $tmp2= split("\|",$entry);
+          $tmp[$tmp2[0]]= $entry;
+        }
       }
     }
     $this->goExportEntry = $tmp;
 
     /* Always is account... */
     $this->is_account= TRUE;
+
+    /* Check if goShareServer is defined */
+    if((isset($this->attrs['objectClass']))&&(is_array($this->attrs['objectClass']))){ 
+      if(in_array("goShareServer",$this->attrs['objectClass'])){
+        $this->goShareServer = true;    
+      }
+    }
   }
 
   function addToList($entry){
@@ -82,6 +93,9 @@ class servservice extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     /* Fill templating stuff */
     $smarty= get_smarty();
 
@@ -182,8 +196,12 @@ class servservice extends plugin
       }
     }
 
-    if(!count($this->goExportEntry)){
+    if(!$this->goShareServer){
       $smarty->assign("goShareServerState", " disabled ");
+      $smarty->assign("goExportEntryACL", " disabled ");
+    }else{
+      $smarty->assign("goShareServerState", "  ");
+      $smarty->assign("goExportEntryACL", "  ");
     }
 
     /* Different handling for checkbox */
@@ -227,6 +245,12 @@ class servservice extends plugin
         $this->goXdmcpIsEnabled= "false";
       }
         
+      /* Save xdmcp is enabled flag */
+      if (isset($_POST['goShareServer'])){
+        $this->goShareServer = true;
+      } else {
+        $this->goShareServer = false;
+      }
     }
   }