From 2d461e8084bbecf914c54035cb4d9264de1b3184 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 1 Sep 2006 04:25:30 +0000 Subject: [PATCH] Initial acl fixes for workstation Startup git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4562 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_workstationStartup.inc | 41 ++++++----- plugins/admin/systems/workstationStartup.tpl | 70 +++++++++++++++---- 2 files changed, 80 insertions(+), 31 deletions(-) diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index ba39d60db..65dbad219 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -469,14 +469,14 @@ class workstartup extends plugin /* Add module */ if (isset ($_POST['add_module'])){ - if ($_POST['module'] != "" && chkacl ($this->acl, "gotoModule") == ""){ + if ($_POST['module'] != "" && $this->acl_is_writeable("gotoModule")){ $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("gotoModule")){ $this->del_list ($this->gotoModules, $_POST['modules_list']); } } @@ -580,6 +580,13 @@ class workstartup extends plugin /* Show main page */ $smarty= get_smarty(); + + /* Assign ACLs to smarty */ + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + $smarty->assign("SelectBoxLdapServer",""); /* In this section server shares will be defined @@ -658,7 +665,6 @@ class workstartup extends plugin $smarty->assign("SelectBoxLdapServer",$SelectBoxLdapServer->DrawList()); - $smarty->assign("gotoLdapServerACL", chkacl($this->acl, "gotoLdapServer")); foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $val){ $smarty->assign("$val", $this->$val); } @@ -666,7 +672,6 @@ class workstartup extends plugin /* Values */ foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass","FAIdebianMirror","FAIrelease") as $val){ $smarty->assign($val, $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); } $smarty->assign("FAIdebianMirrors",$this->getFAIdebianMirrors()); @@ -675,8 +680,13 @@ class workstartup extends plugin $smarty->assign("FAIclasses",$this->selectFriendlyClasses()); $smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses())); $smarty->assign("FAIclassKeys",$this->FAIclass); - $smarty->assign("InheritedFAIrelease",$this->InheritedFAIrelease); - + + $inheritedRelease = array(); + if(!empty($this->InheritedFAIrelease)){ + $inheritedRelease[$this->InheritedFAIrelease]= $this->InheritedFAIrelease; + } + $smarty->assign("InheritedFAIrelease",$inheritedRelease); + $div = new divSelectBox("WSFAIscriptClasses"); $div -> SetHeight("110"); $str_up = "  "; @@ -732,11 +742,6 @@ class workstartup extends plugin $smarty->assign("debugbootup", ""); } - /* ACL's */ - foreach (array("gotoKernelParameters", "gotoModules", "gotoFilesystem","FAIclass") as $value){ - $smarty->assign($value."ACL", chkacl($this->acl, "$value")); - } - /* Show main page */ return($smarty->fetch (get_template_path('workstationStartup.tpl', TRUE,dirname(__FILE__)))); } @@ -864,12 +869,12 @@ class workstartup 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"]; } @@ -1094,11 +1099,15 @@ class workstartup extends plugin "gotoLdapServer" => _("Ldap server"), "gotoBootKernel" => _("Boot kernel"), "gotoKernelParameters" => _("Kernel parameter"), - "FAIclass" => _("FAI classes"), - "FAIstatus" => _("FAI status flag"), + + "gotoModules" => _("Kernel modules"), "gotoShare" => _("Shares"), + + "FAIclass" => _("FAI classes"), "FAIdebianMirror" => _("Debian mirror"), - "FAIrelease" => _("Debian release")) + "FAIrelease" => _("Debian release"), + + "FAIstatus" => _("FAI status flag")) // #FIXME is this acl realy necessary ? )); } } diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl index 117bb7a83..7f7b9e807 100644 --- a/plugins/admin/systems/workstationStartup.tpl +++ b/plugins/admin/systems/workstationStartup.tpl @@ -7,20 +7,28 @@ - {html_options options=$gotoBootKernels selected=$gotoBootKernel} +{/render} - + +{render acl=$gotoKernelParametersACL} + +{/render} +
+{render acl=$gotoLdapServerACL} {$SelectBoxLdapServer} +{/render} @@ -48,9 +56,11 @@ +{render acl=$FAIdebianMirrorACL} +{/render} +{render acl=$FAIdebianMirrorACL} + - {if $javascript eq 'false'}{/if} +{/render} +{if $javascript eq 'false'} +{render acl=$FAIdebianMirrorACL} + +{/render} +{/if} +{render acl=$FAIreleaseACL} +{/render}

 {t}Assigned FAI classes{/t}

+{render acl=$FAIclassACL} {$FAIScriptlist} +{/render} - {html_options values=$FAIclassesKeys output=$FAIclasses} @@ -115,14 +136,22 @@

{t}Kernel modules (format: name parameters){/t}

+{render acl=$gotoModulesACL} +{/render}
- -   - +{render acl=$gotoModulesACL} + +{/render} +{render acl=$gotoModulesACL} +   +{/render} +{render acl=$gotoModulesACL} + +{/render} @@ -130,18 +159,28 @@
- {html_options values=$gotoShareKeys output=$gotoShares} +{/render}
- {html_options values=$gotoShareSelectionKeys output=$gotoShareSelections} - - - +{/render} +{render acl=$gotoShareACL} + +{/render} +{render acl=$gotoShareACL} + +{/render} +{render acl=$gotoShareACL} + +{/render}
@@ -154,3 +193,4 @@ + -- 2.30.2