Code

Initial term startup acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 29 Sep 2006 05:03:21 +0000 (05:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 29 Sep 2006 05:03:21 +0000 (05:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4829 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/terminalStartup.tpl

index 3ec5c115c0001098933f0df8dbd1b733921cea3d..a5df4d4d31d55b890cf25615d6b712d413ecf7d3 100644 (file)
@@ -147,8 +147,8 @@ class termstartup extends plugin
 
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
 
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
@@ -164,14 +164,14 @@ class termstartup extends plugin
 
     /* Add module */
     if (isset ($_POST['add_module'])){
-      if ($_POST['module'] != "" && chkacl ($this->acl, "gotoModule") == ""){
+      if ($_POST['module'] != "" && $this->acl_is_writeable("gotoMode")){
         $this->add_list ($this->gotoModules, $_POST['module']);
       }
     }
 
     /* Delete module */
     if (isset ($_POST['delete_module'])){
-      if (count($_POST['modules_list']) && chkacl ($this->acl, "gotoModule") == ""){
+      if (count($_POST['modules_list']) && $this->acl_is_writeable("gotoMode")){
         $this->del_list ($this->gotoModules, $_POST['modules_list']);
       }
     }
@@ -179,6 +179,12 @@ class termstartup 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));
+    }
+
 
        /* In this section server shares will be defined
      * A user can select one of the given shares and a mount point
@@ -248,7 +254,6 @@ class termstartup extends plugin
 
     $smarty->assign("SelectBoxLdapServer",$SelectBoxLdapServer->DrawList());
 
-    $smarty->assign("gotoShareACL", chkacl($this->acl, "gotoShareACL"));
     foreach (array("gotoModules" ) as $val){
       $smarty->assign("$val", $this->$val);
     }
@@ -256,7 +261,6 @@ class termstartup extends plugin
     /* Values */
     foreach(array("gotoBootKernel", "customParameters") as $val){
       $smarty->assign($val, $this->$val);
-      $smarty->assign($val."ACL", chkacl($this->acl, $val));
     }
 
     /* Radio button group */
@@ -276,18 +280,15 @@ class termstartup extends plugin
       $smarty->assign("debugbootup", "");
     }
 
-    /* ACL's */
-    foreach (array("gotoKernelParameters", "gotoModules") as $value){
-      $smarty->assign($value."ACL", chkacl($this->acl, "$value"));
-    }
-
     /* Show main page */
     return($smarty->fetch (get_template_path('terminalStartup.tpl', TRUE)));
   }
 
   function remove_from_parent()
   {
+    if($this->acl_is_removeable()){
       $this->handle_post_events("remove");
+    }
   }
 
 
@@ -297,12 +298,12 @@ class termstartup extends plugin
     plugin::save_object();
 
     /* Save group radio buttons */
-    if (chkacl ($this->acl, "bootmode") == "" && isset($_POST["bootmode"])){
+    if ($this->acl_is_writeable("bootmode") && isset($_POST["bootmode"])){
       $this->bootmode= $_POST["bootmode"];
     }
 
     /* Save kernel parameters */
-    if (chkacl ($this->acl, "gotoKernelParameters") == "" && isset($_POST["customParameters"])){
+    if ($this->acl_is_writeable("gotoKernelParameters") && isset($_POST["customParameters"])){
       $this->customParameters= $_POST["customParameters"];
     }
   }
@@ -447,7 +448,9 @@ class termstartup extends plugin
           "plCategory"    => array("terminal"),
 
           "plProvidedAcls"=> array(
-            "gotoLdapServer"      => _("Ldap server"), 
+            "gotoLdapServer"      => _("Ldap server"),
+            "gotoShare"           => _("Shares"),
+            "gotoModules"         => _("Kernel modules"),
             "gotoBootKernel"      => _("Boot kernel"), 
             "gotoKernelParameters"=> _("Kernel parameter"))
           ));
index 6a5d38f02a7c53a1d14f2930071dcff0a50b4083..91e64415eea825deabd543c306825ab9022874f5 100644 (file)
@@ -7,20 +7,27 @@
     <tr>
      <td style="width:30%"><LABEL for="gotoBootKernel">{t}Boot kernel{/t}</LABEL></td>
      <td>
-       <select id="gotoBootKernel" name="gotoBootKernel" {$gotoBootKernelACL}>
+{render acl=$gotoBootKernelACL}
+       <select id="gotoBootKernel" name="gotoBootKernel">
        {html_options options=$gotoBootKernels  selected=$gotoBootKernel}
        <option disabled>&nbsp;</option>
        </select>
+{/render}
      </td>
     </tr>
     <tr>
      <td><LABEL for="customParameters">{t}Custom options{/t}</LABEL></td>
-     <td><input name="customParameters" id="customParameters"  size=25 maxlength=500 {$gotoKernelParametersACL}
+     <td>
+{render acl=$gotoKernelParametersACL}
+      <input name="customParameters" id="customParameters"  size=25 maxlength=500
                 value="{$customParameters}" title="{t}Enter any parameters that should be passed to the kernel as append line during bootup{/t}"></td>
+{/render}
     </tr>
     <tr>
      <td colspan="2" style='vertical-align:top;padding-top:3px;width:100%'><LABEL for="gotoLdapServer">{t}LDAP server{/t}</LABEL>
+{render acl=$gotoLdapServerACL}
                {$SelectBoxLdapServer}
+{/render}
      </td>
     </tr>
    </table>
   </td>
   
   <td style="vertical-align:top;">
-    <input type="radio" name="bootmode" value="G" title="{t}Select if terminal supports graphical startup with progress bar{/t}" {$graphicalbootup} {$gotoKernelParametersACL}>
+{render acl=$gotoKernelParametersACL}
+    <input type="radio" name="bootmode" value="G" title="{t}Select if terminal supports graphical startup with progress bar{/t}" {$graphicalbootup}>
+{/render}
     {t}use graphical bootup{/t}
     <br>
-    <input type="radio" name="bootmode" value="T" title="{t}Select if terminal should boot in text mode{/t}" {$textbootup} {$gotoKernelParametersACL}>
+{render acl=$gotoKernelParametersACL}
+    <input type="radio" name="bootmode" value="T" title="{t}Select if terminal should boot in text mode{/t}" {$textbootup}>
+{/render}
     {t}use standard linux textual bootup{/t}
     <br>
-    <input type="radio" name="bootmode" value="D" title="{t}Select to get more verbose output during startup{/t}" {$debugbootup} {$gotoKernelParametersACL}>
+{render acl=$gotoKernelParametersACL}
+    <input type="radio" name="bootmode" value="D" title="{t}Select to get more verbose output during startup{/t}" {$debugbootup}>
+{/render}
     {t}use debug mode for startup{/t}
   </td>
  </tr>
    <h2>
     <img class="center" alt="" align="middle" src="images/hardware.png"> {t}Kernel modules (format: name parameters){/t}
    </h2>
+{render acl=$gotoModulesACL}
     <select style="width:100%;" name="modules_list[]" size=15 multiple title="{t}Add additional modules to load on startup{/t}">
      {html_options values=$gotoModules output=$gotoModules}
         <option disabled>&nbsp;</option>
     </select>
+{/render}
     <br>
-    <input name="module" size=30 align=middle maxlength=30 {$gotoModulesACL}>
-    <input type=submit value="{t}Add{/t}" name="add_module" {$gotoModulesACL}>&nbsp;
-    <input type=submit value="{t}Delete{/t}" name="delete_module" {$gotoModulesACL}>
+{render acl=$gotoModulesACL}
+    <input name="module" size=30 align=middle maxlength=30>
+{/render}
+{render acl=$gotoModulesACL}
+    <input type=submit value="{t}Add{/t}" name="add_module">&nbsp;
+{/render}
+{render acl=$gotoModulesACL}
+    <input type=submit value="{t}Delete{/t}" name="delete_module">
+{/render}
   </td>
 
   <td style="padding-left:10px;border-left:1px solid #A0A0A0;vertical-align:top">
         <table summary="" style="width:100%">
                 <tr>
                         <td>
-                        <select style="width:100%;" name="gotoShare" multiple size=15 {$gotoShareACL} id="gotoShare">
-        {html_options values=$gotoShareKeys output=$gotoShares}
-        <option disabled>&nbsp;</option>
-                                </select>
+{render acl=$gotoShareACL}
+                        <select style="width:100%;" name="gotoShare" multiple size=15 id="gotoShare">
+                               {html_options values=$gotoShareKeys output=$gotoShares}
+                               <option disabled>&nbsp;</option>
+                        </select>
+{/render}
                                 <br>
-                        <select name="gotoShareSelection" {$gotoShareACL}>
-        {html_options values=$gotoShareSelectionKeys output=$gotoShareSelections}
-        <option disabled>&nbsp;</option>
+{render acl=$gotoShareACL}
+                               <select name="gotoShareSelection">
+                                       {html_options values=$gotoShareSelectionKeys output=$gotoShareSelections}
+                                       <option disabled>&nbsp;</option>
                                 </select>
-                                <input type="text" size=15 {$gotoShareACL} name="gotoShareMountPoint" value="{t}Mountpoint{/t}">
-                                <input type="submit" {$gotoShareACL} name="gotoShareAdd" value="{t}Add{/t}">
-                                <input type="submit" {$gotoShareACL} name="gotoShareDel" value="{t}Remove{/t}">
+{/render}
+{render acl=$gotoShareACL}
+                                <input type="text" size=15 name="gotoShareMountPoint" value="{t}Mountpoint{/t}">
+{/render}
+{render acl=$gotoShareACL}
+                                <input type="submit" name="gotoShareAdd" value="{t}Add{/t}">
+{/render}
+{render acl=$gotoShareACL}
+                                <input type="submit" name="gotoShareDel" value="{t}Remove{/t}">
+{/render}
                         </td>
                 </tr>
         </table>