Code

Updated Terminal Server Service
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Jan 2008 09:46:04 +0000 (09:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Jan 2008 09:46:04 +0000 (09:46 +0000)
-Session types now selectable.
-Removed Font-Path
 * Still some font-path dependencies to config.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8616 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/services/terminal/class_goTerminalServer.inc
gosa-plugins/goto/admin/systems/services/terminal/goTerminalServer.tpl

index e832de04cc36ff4603bcc9f2962ee5ce657617c2..0dc4184cbdfd793f446fbc450b62960e4154cbdb 100644 (file)
@@ -8,9 +8,9 @@ class goTerminalServer extends goService{
 
   /* This plugin only writes its objectClass */
   var $objectclasses    = array("goTerminalServer");
-  var $attributes       = array("goXdmcpIsEnabled", "goFontPath");
+  var $attributes       = array("goXdmcpIsEnabled","gotoSessionType");
   var $StatusFlag       = "goTerminalServerStatus";
+
   /* This class can't be assigned twice so it conflicts with itsself */
   var $conflicts        = array("goTerminalServer");
 
@@ -20,14 +20,23 @@ class goTerminalServer extends goService{
   var $cn                      = "";
   var $goTerminalServerStatus  = "";
   var $goXdmcpIsEnabled        = false;  
-  var $goFontPath              = "";
-  var $view_logged  =FALSE;
+  var $view_logged             = FALSE;
 
+  var $gotoSessionType         = array();
 
   function goTerminalServer(&$config,$dn)
   {
     goService::goService($config,$dn);
     $this->DisplayName = _("Terminal service");
+
+    $tmp = array();
+    if(isset($this->attrs['gotoSessionType'])){
+      for($i =0; $i < $this->attrs['gotoSessionType']['count'] ; $i++){
+        $tmp[] = $this->attrs['gotoSessionType'][$i];
+      }
+    }
+    $this->gotoSessionType = $tmp;
+    $this->gotoSessionTypes= array("LDM","XDCMP","RDP","CITRIX"); 
   }
 
 
@@ -49,6 +58,17 @@ class goTerminalServer extends goService{
     foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
     }
+
+    $tmp = array();
+    foreach($this->gotoSessionTypes as $type){
+      if(in_array($type,$this->gotoSessionType)){
+        $tmp[$type] = TRUE;
+      }else{
+        $tmp[$type] = FALSE;
+      }
+    }
+    $smarty->assign("gotoSessionTypes",$tmp);
+
     return($smarty->fetch(get_template_path("goTerminalServer.tpl",TRUE,dirname(__FILE__))));
   }
 
@@ -70,6 +90,8 @@ class goTerminalServer extends goService{
       $this->attrs['goXdmcpIsEnabled'] = "0";
     }
 
+    $this->attrs['gotoSessionType'] = array_values($this->gotoSessionType);
+
     /* Check if this is a new entry ... add/modify */
     $ldap = $this->config->get_ldap_link();
     $ldap->cat($this->dn,array("objectClass"));
@@ -94,10 +116,6 @@ class goTerminalServer extends goService{
   function check()
   { 
     $message = plugin::check();
-    if(empty($this->goFontPath)){
-      $message[]=_("Terminal server, must have fontpath specified.");
-    }
-
     return($message);
   }
 
@@ -106,6 +124,14 @@ class goTerminalServer extends goService{
   {
     if(isset($_POST['goTerminalServerPosted'])){
       plugin::save_object();
+
+      $this->gotoSessionType = array();
+      foreach($this->gotoSessionTypes as $attr){
+        if(isset($_POST['gotoSessionType_'.$attr])){
+          $this->gotoSessionType[] = $attr;
+        }
+      }
+
       if($this->acl_is_writeable("goXdmcpIsEnabled")){
         if(isset($_POST['goXdmcpIsEnabled'])){
           $this->goXdmcpIsEnabled = true;
@@ -117,6 +143,20 @@ class goTerminalServer extends goService{
   } 
 
 
+  function PrepareForCopyPaste($obj)
+  {
+    plugin::PrepareForCopyPaste($obj);
+    $tmp = array();
+    if(isset($obj['gotoSessionType'])){
+      for($i =0; $i < $obj['gotoSessionType']['count'] ; $i++){
+        $tmp[] = $obj['gotoSessionType'][$i];
+      }
+    }
+    $this->gotoSessionType = $tmp;
+    $this->gotoSessionTypes= array("LDM","XDCMP","RDP","CITRIX"); 
+  }
+
+
   /* Return plugin informations for acl handling */
   static function plInfo()
   {
@@ -130,8 +170,7 @@ class goTerminalServer extends goService{
           "plCategory"    => array("server"),
 
           "plProvidedAcls"=> array(
-            "goXdmcpIsEnabled"  => _("Temporary disable login"),
-            "goFontPath"        => _("Font path"))
+            "goXdmcpIsEnabled"  => _("Temporary disable login"))
           ));
   }
 
index 5fca2091f22852afc3faf605f0411ac1e1f6020f..349e9a6a34e0ad30f4d454e1e96419b88cdda1e4 100644 (file)
@@ -1,7 +1,7 @@
-<h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}Terminal service{/t}</h2>
 <table summary="">
     <tr>
      <td colspan=2>
+               <h2><img class="center" alt="" align="middle" src="images/rightarrow.png" /> {t}Terminal service{/t}</h2>
 {render acl=$goXdmcpIsEnabledACL}
       <input type="checkbox" value="true" name="goXdmcpIsEnabled" id="Temporariid" {if $goXdmcpIsEnabled} checked {/if}>
 {/render}
@@ -9,11 +9,12 @@
      </td>
     </tr>
     <tr>
-     <td>{t}Font path{/t}</td>
-     <td> 
-{render acl=$goXdmcpIsEnabledACL}
-      <input type="text" value="{$goFontPath}" name="goFontPath" id="FontPathId">
-{/render}
+     <td colspan=2>
+               <h2>{t}Supported session types{/t}</h2>
+                       {foreach from=$gotoSessionTypes item=item key=key}
+                               <input class="center" type="checkbox" name="gotoSessionType_{$key}" 
+                                       {if $item} checked {/if}>&nbsp;{$key} <br>
+                       {/foreach}
      </td>
     </tr>
    </table>