From a3ac1e4fd5d96719c1854e5496b433e6b3587e99 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 29 Sep 2006 05:03:21 +0000 Subject: [PATCH] Initial term startup acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4829 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_terminalStartup.inc | 31 +++++---- plugins/admin/systems/terminalStartup.tpl | 67 ++++++++++++++----- 2 files changed, 66 insertions(+), 32 deletions(-) diff --git a/plugins/admin/systems/class_terminalStartup.inc b/plugins/admin/systems/class_terminalStartup.inc index 3ec5c115c..a5df4d4d3 100644 --- a/plugins/admin/systems/class_terminalStartup.inc +++ b/plugins/admin/systems/class_terminalStartup.inc @@ -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")) )); diff --git a/plugins/admin/systems/terminalStartup.tpl b/plugins/admin/systems/terminalStartup.tpl index 6a5d38f02..91e64415e 100644 --- a/plugins/admin/systems/terminalStartup.tpl +++ b/plugins/admin/systems/terminalStartup.tpl @@ -7,20 +7,27 @@ - {html_options options=$gotoBootKernels selected=$gotoBootKernel} +{/render} - +{render acl=$gotoKernelParametersACL} + +{/render} +{render acl=$gotoLdapServerACL} {$SelectBoxLdapServer} +{/render} @@ -32,13 +39,19 @@ - +{render acl=$gotoKernelParametersACL} + +{/render} {t}use graphical bootup{/t}
- +{render acl=$gotoKernelParametersACL} + +{/render} {t}use standard linux textual bootup{/t}
- +{render acl=$gotoKernelParametersACL} + +{/render} {t}use debug mode for startup{/t} @@ -52,14 +65,22 @@

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

+{render acl=$gotoModulesACL} +{/render}
- -   - +{render acl=$gotoModulesACL} + +{/render} +{render acl=$gotoModulesACL} +   +{/render} +{render acl=$gotoModulesACL} + +{/render} @@ -67,18 +88,28 @@
- +{render acl=$gotoShareACL} + +{/render}
- + {html_options values=$gotoShareSelectionKeys output=$gotoShareSelections} + - - - +{/render} +{render acl=$gotoShareACL} + +{/render} +{render acl=$gotoShareACL} + +{/render} +{render acl=$gotoShareACL} + +{/render}
-- 2.30.2