Code

Added acls for terminal service
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 29 Sep 2006 06:31:53 +0000 (06:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 29 Sep 2006 06:31:53 +0000 (06:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4830 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalService.inc
plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/terminalService.tpl

index cc4b868caa87d25a37fc2d82d06a74d63e322c5a..d449f089bc7f35a0a5b4b72c0dd37ee12d11c073 100644 (file)
@@ -256,6 +256,13 @@ class termservice extends plugin
     /* Show main page */
     $smarty= get_smarty();
 
+    /* Assign acls */
+    $tmp= $this->plInfo();
+    foreach($tmp['plProvidedAcls'] as $name => $translation){
+      $smarty->assign($name."ACL",$this->getacl($name));
+    }
+
+
     /* Arrays */ 
     foreach(array("XMethods", "XDrivers", "XResolutions", "XColordepths",
           "gotoScannerModels", "XKbModels","XKbVariants",
@@ -277,13 +284,11 @@ class termservice extends plugin
           "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport") as $val){
 
       $smarty->assign($val."_select", $this->$val);
-      $smarty->assign($val."ACL", chkacl($this->acl, $val));
     }
 
     /* Variables */
     foreach(array("gotoXHsync", "gotoXVsync") as $val){
       $smarty->assign($val, $this->$val);
-      $smarty->assign($val."ACL", chkacl($this->acl, $val));
     }
     $smarty->assign("staticAddress", "");
 
@@ -294,14 +299,12 @@ class termservice extends plugin
       } else {
         $smarty->assign("$val", "");
       }
-      $smarty->assign($val."ACL", chkacl($this->acl, "gotoLpdEnable"));
     }
 
     /* Phone stuff */
     $smarty->assign ("goFonHardware", $this->goFonHardware);
     $hl= "<select size=\"1\" name=\"goFonHardware\" title=\"".
-         _("Choose the phone located at the current terminal")."\" ".
-         chkacl($this->acl, "goFonHardware").">\n";
+         _("Choose the phone located at the current terminal")."\" >\n";
     foreach ($this->hardware_list as $cn => $description){
       if ($cn == $this->goFonHardware){
         $selected= "selected";
@@ -338,10 +341,12 @@ class termservice extends plugin
     if (isset ($_POST['gotoXMethod'])){
       foreach (array("gotoLpdEnable", "gotoScannerEnable") as $val){
 
-        if (!isset ($_POST["$val"]) && chkacl ($this->acl, "$val") == ""){
-          $this->$val= FALSE;
-        } else {
-          $this->$val= TRUE;
+        if($this->acl_is_writeable($val)){
+          if (!isset ($_POST["$val"])){
+            $this->$val= FALSE;
+          } else {
+            $this->$val= TRUE;
+          }
         }
       }
     }
@@ -360,10 +365,10 @@ class termservice extends plugin
       /* Check vsync for correct usage */
       $val= preg_replace ("/\s/", "", $this->gotoXVsync);
       if (!preg_match ("/^\d+(\.\d+)?(\-\d+(\.\d+)?)?$/", $val)
-          && chkacl ($this->acl, "gotoXVsync") == ""){
+          && $this->acl_is_writeable("gotoXVsync")){
 
         $message[]= _("Please specify a valid VSync range.");
-      } elseif (chkacl ($this->acl, "gotoXVsync") == ""){
+      } elseif ($this->acl_is_writeable("gotoXVsync")){
         list($v1,$v2)= split ("-", $val);
         if ($v2 != ""){
           if ($v1 > $v2){
@@ -375,10 +380,10 @@ class termservice extends plugin
       /* Check hsync for correct usage */
       $val= preg_replace ("/\s/", "", $this->gotoXHsync);
       if (!preg_match ("/^\d+(\.\d+)?(\-\d+(\.\d+)?)?$/", $val)
-          && chkacl ($this->acl, "gotoXHsync") == ""){
+          && $this->acl_is_writeable("gotoXHsync")){
 
         $message[]= _("Please specify a valid HSync range.");
-      } elseif (chkacl ($this->acl, "gotoXHsync") == ""){
+      } elseif ($this->acl_is_writeable("gotoXHsync")){
         list($v1,$v2)= split ("-", $val);
         if ($v2 != ""){
           if ($v1 > $v2){
index a5df4d4d31d55b890cf25615d6b712d413ecf7d3..4b30c443e80531d05dfefd003acdaa04ddeb87e7 100644 (file)
@@ -197,7 +197,7 @@ class termstartup extends plugin
     /* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
      * This entry will be, a combination of mountPoint and sharedefinitions
      */
-    if(isset($_POST['gotoShareAdd'])){
+    if(isset($_POST['gotoShareAdd']) && $this->acl_is_writeable("gotoShare")){
       /* We assign a share to this user, if we don't know where to mount the share */
       if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
         print_red(_("You must specify a valid mount point."));
@@ -213,7 +213,7 @@ class termstartup extends plugin
     /* if the Post  gotoShareDel is set, someone asked GOsa to delete the selected entry (if there is one selected)
      * If there is no defined share selected, we will abort the deletion without any message
      */
-    if((isset($_POST['gotoShareDel']))&&(isset($_POST['gotoShare']))){
+    if((isset($_POST['gotoShareDel']))&&(isset($_POST['gotoShare'])) && $this->acl_is_writeable("gotoShare")){
       unset($this->gotoShares[$_POST['gotoShare']]);
     }
 
index db8fc0e295597ec1827b3d730bd0c9d8c0ac1dc7..9338f790528da97d7c0f4fae128139c0f6fc35b9 100644 (file)
@@ -6,25 +6,31 @@
     <tr>
      <td><LABEL for="gotoXKbModel">{t}Model{/t}</LABEL></td>
      <td>
-      <select id="gotoXKbModel" name="gotoXKbModel" title="{t}Choose keyboard model{/t}" {$gotoXKbModelACL}>
+{render acl=$gotoXKbModelACL}
+      <select id="gotoXKbModel" name="gotoXKbModel" title="{t}Choose keyboard model{/t}" >
        {html_options options=$XKbModels selected=$gotoXKbModel_select}
       </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td><LABEL for="gotoXKbLayout">{t}Layout{/t}</LABEL></td>
      <td>
-      <select id="gotoXKbLayout" name="gotoXKbLayout" title="{t}Choose keyboard layout{/t}" {$gotoXKbLayoutACL}>
+{render acl=$gotoXKbLayoutACL}
+      <select id="gotoXKbLayout" name="gotoXKbLayout" title="{t}Choose keyboard layout{/t}" >
        {html_options options=$XKbLayouts selected=$gotoXKbLayout_select}
       </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td><LABEL for="gotoXKbVariant">{t}Variant{/t}</LABEL></td>
      <td>
-      <select id="gotoXKbVariant" name="gotoXKbVariant" title="{t}Choose keyboard variant{/t}" {$gotoXKbVariantACL}>
+{render acl=$gotoXKbVariantACL}
+      <select id="gotoXKbVariant" name="gotoXKbVariant" title="{t}Choose keyboard variant{/t}" >
        {html_options options=$XKbVariants selected=$gotoXKbVariant_select}
       </select>
+{/render}
      </td>
     </tr>
    </table>
     <tr>
      <td><LABEL for="gotoXMouseType">{t}Type{/t}</LABEL></td>
      <td>
-      <select name="gotoXMouseType" id="gotoXMouseType" title="{t}Choose mouse type{/t}" {$gotoXMouseTypeACL}>
+{render acl=$gotoXMouseTypeACL}
+      <select name="gotoXMouseType" id="gotoXMouseType" title="{t}Choose mouse type{/t}" >
        {html_options options=$MouseTypes selected=$gotoXMouseType_select}
       </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td><LABEL for="gotoXMouseport">{t}Port{/t}</LABEL></td>
      <td>
-      <select id="gotoXMouseport" name="gotoXMouseport" title="{t}Choose mouse port{/t}" {$gotoXMouseportACL}>
+{render acl=$gotoXMouseportACL}
+      <select id="gotoXMouseport" name="gotoXMouseport" title="{t}Choose mouse port{/t}" >
        {html_options options=$MousePorts selected=$gotoXMouseport_select}
       </select>
+{/render}
      </td>
     </tr>
    </table>
@@ -67,7 +77,9 @@
    <table style="width:100%" border=0 summary="">
     <tr>
      <td>{t}Telephone{/t}&nbsp;
+{render acl=$goFonHardwareACL}
          {$hardware_list}
+{/render}
      </td>
     </tr>
    </table>
     <tr>
      <td><LABEL for="gotoXDriver">{t}Driver{/t}</LABEL></td>
      <td>
-      <select id="gotoXDriver" name="gotoXDriver" title="{t}Choose graphic driver that is needed by the installed graphic board{/t}" {$gotoXDriverACL}>
+{render acl=$gotoXDriverACL}
+      <select id="gotoXDriver" name="gotoXDriver" title="{t}Choose graphic driver that is needed by the installed graphic board{/t}" >
        {html_options values=$XDrivers output=$XDrivers selected=$gotoXDriver_select}
       </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td><LABEL for="gotoXResolution">{t}Resolution{/t}</LABEL></td>
      <td>
-      <select id="gotoXResolution" name="gotoXResolution" title="{t}Choose screen resolution used in graphic mode{/t}" {$gotoXResolutionACL}>
+{render acl=$gotoXResolutionACL}
+      <select id="gotoXResolution" name="gotoXResolution" title="{t}Choose screen resolution used in graphic mode{/t}" >
        {html_options options=$XResolutions selected=$gotoXResolution_select}
       </select>
+{/render }
      </td>
     </tr>
     <tr>
      <td><LABEL for="gotoXColordepth">{t}Color depth{/t}</LABEL></td>
      <td>
-      <select id="gotoXColordepth" name="gotoXColordepth" title="{t}Choose colordepth used in graphic mode{/t}" {$gotoXColordepthACL}>
+{render acl=$gotoXColordepthACL}
+      <select id="gotoXColordepth" name="gotoXColordepth" title="{t}Choose colordepth used in graphic mode{/t}" >
        {html_options options=$XColordepths selected=$gotoXColordepth_select}
       </select>
+{/render}
      </td>
     </tr>
    </table>
     </tr>
     <tr>
      <td><LABEL for="gotoXHsync">{t}HSync{/t}</LABEL></td>
-     <td><input id="gotoXHsync" name="gotoXHsync" size=10 maxlength=60 {$gotoXHsyncACL}
+     <td>
+{render acl=$gotoXHsyncACL}
+       <input id="gotoXHsync" name="gotoXHsync" size=10 maxlength=60 
                 value="{$gotoXHsync}" title="{t}Horizontal refresh frequency for installed monitor{/t}"> kHz</td>
+{/render}
     </tr>
     <tr>
      <td><LABEL for="gotoXVsync">{t}VSync{/t}</LABEL></td>
-     <td><input id="gotoXVsync"  name="gotoXVsync" size=10 maxlength=60 {$gotoXVsyncACL}
+     <td>
+{render acl=$gotoXVsyncACL}
+      <input id="gotoXVsync"  name="gotoXVsync" size=10 maxlength=60 
                 value="{$gotoXVsync}" title="{t}Vertical refresh frequency for installed monitor{/t}"> Hz</td>
+{/render}
     </tr>
    </table>
 
      <td></td>
      <td><LABEL for="gotoXMethod">{t}Connect method{/t}</LABEL></td>
      <td>
-      <select name="gotoXMethod" id="gotoXMethod" title="{t}Choose method to connect to terminal server{/t}" {$gotoXMethodACL}>
+{render acl=$gotoXMethodACL}
+      <select name="gotoXMethod" id="gotoXMethod" title="{t}Choose method to connect to terminal server{/t}" >
        {html_options options=$XMethods selected=$gotoXMethod_select}
       </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td></td>
      <td><LABEL for="gotoXdmcpServer">{t}Terminal server{/t}</LABEL></td>
      <td>
-      <select id="gotoXdmcpServer" name="gotoXdmcpServer" title="{t}Select specific terminal server to use{/t}" {$gotoXdmcpServerACL}>
+{render acl=$gotoXdmcpServerACL}
+      <select id="gotoXdmcpServer" name="gotoXdmcpServer" title="{t}Select specific terminal server to use{/t}" >
        {html_options values=$xdmcpservers output=$xdmcpservers selected=$gotoXdmcpServer_select}
       </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td></td>
      <td><LABEL for="gotoFontPath">{t}Font server{/t}</LABEL></td>
      <td>
-      <select name="gotoFontPath" id="gotoFontPath" title="{t}Select specific font server to use{/t}" {$gotoFontPathACL}>
+{render acl=$gotoFontPathACL}
+      <select name="gotoFontPath" id="gotoFontPath" title="{t}Select specific font server to use{/t}" >
        {html_options values=$fontservers output=$fontservers selected=$gotoFontPath_select}
       </select>
+{/render}
      </td>
     </tr>
    </table>
  <tr>
   <td style="width:50%; vertical-align:top;">
    <h2><img class="center" alt="" align="middle" src="images/printer.png"><LABEL for="gotoLpdEnable"> {t}Print device{/t}</LABEL></h2>
-   <input id="gotoLpdEnable" type=checkbox name="gotoLpdEnable" value="1" {$gotoLpdEnable} {$gotoLpdEnableACL} title="{t}Select to start IPP based printing service on terminal{/t}">
+{render acl=$gotoLpdEnableACL}
+   <input id="gotoLpdEnable" type=checkbox name="gotoLpdEnable" value="1" {$gotoLpdEnable} title="{t}Select to start IPP based printing service on terminal{/t}">
+{/render}
    {t}Provide print services{/t}
    <br>
 
      <td><div style="width:20px;"></div></td>
      <td><LABEL for="gotoLpdServer">{t}Spool server{/t}</LABEL></td>
      <td>
-      <select name="gotoLpdServer" id="gotoLpdServer" title="{t}Select NFS filesystem to place spool files on{/t}" {$gotoLpdServerACL}>
+{render acl=$gotoLpdServerACL}
+      <select name="gotoLpdServer" id="gotoLpdServer" title="{t}Select NFS filesystem to place spool files on{/t}" >
        {html_options values=$nfsservers output=$nfsservers selected=$gotoLpdServer_select}
       </select>
+{/render}
      </td>
     </tr>
   </table>
 
   <td style="vertical-align:top;">
    <h2><img class="center" alt="" align="middle" src="images/scanner.png"> {t}Scan device{/t}</h2>
-   <input type=checkbox name="gotoScannerEnable" value="1" title="{t}Select to start SANE scan service on terminal{/t}" {$gotoScannerEnable} {$gotoScannerEnableACL}>
+{render acl=$gotoScannerEnableACL}
+   <input type=checkbox name="gotoScannerEnable" value="1" title="{t}Select to start SANE scan service on terminal{/t}" {$gotoScannerEnable} >
+{/render}
    {t}Provide scan services{/t}
    <br>
    <table summary="">
      <td><div style="width:20px;"></div></td>
      <td><LABEL for="gotoScannerModel">{t}Model{/t}</LABEL></td>
      <td>
-      <select name="gotoScannerModel" id="gotoScannerModel" title="{t}Select scanner driver to use{/t}" {$gotoScannerEnableACL}>
+{render acl=$gotoScannerEnableACL}
+      <select name="gotoScannerModel" id="gotoScannerModel" title="{t}Select scanner driver to use{/t}" >
        {html_options values=$gotoScannerModels output=$gotoScannerModels selected=$gotoScannerModel_select}
       </select>
+{/render}
      </td>
     </tr>
   </table>