From 6b0acfc73093784e8faaa14e315c6daf58a2a360 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 19 Sep 2006 11:42:13 +0000 Subject: [PATCH] ServGeneric acls, not finished yet git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4729 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servGeneric.inc | 27 +++++++++++---- plugins/admin/systems/server.tpl | 37 ++++++++++++++------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index 3e616ebec..34397aea6 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -140,14 +140,25 @@ class servgeneric extends plugin /* Fill templating stuff */ $smarty= get_smarty(); + + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translated){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + + /* Assign base ACL */ + $baseACL = $this->getacl("base"); + if(!$this->acl_is_moveable()) { + $baseACL = preg_replace("/w/","",$baseACL); + } + $smarty->assign("baseACL", $baseACL); + $smarty->assign("bases", $this->config->idepartments); /* Assign attributes */ foreach ($this->attributes as $attr){ - $smarty->assign($attr."ACL", chkacl($this->acl, $attr)); $smarty->assign("$attr", $this->$attr); } - $smarty->assign("baseACL", chkacl($this->acl, "base")); $smarty->assign("staticAddress", ""); $smarty->assign("base_select", $this->base); @@ -204,10 +215,12 @@ class servgeneric extends plugin { plugin::save_object(); $this->netConfigDNS->save_object(); - /* Save base, since this is no LDAP attribute */ - if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){ - $this->base= $_POST['base']; + + /* Get base selection */ + if($this->acl_is_moveable() && isset($_POST['base'])){ + $this->base = $_POST['base']; } + } @@ -220,14 +233,14 @@ class servgeneric extends plugin $this->dn= "cn=".$this->cn.",ou=servers,ou=systems,".$this->base; /* must: cn */ - if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){ + if ($this->cn == ""){ $message[]= _("The required field 'Server name' is not set."); } $ui= get_userinfo(); $acl= get_permissions ($this->dn, $ui->subtreeACL); $acl= get_module_permission($acl, "server", $this->dn); - if (chkacl($acl, "create") != ""){ + if (!$this->acl_is_createable() && $this->dn == "new"){ $message[]= _("You have no permissions to create a server on this 'Base'."); } diff --git a/plugins/admin/systems/server.tpl b/plugins/admin/systems/server.tpl index f33a589da..3bd985a83 100644 --- a/plugins/admin/systems/server.tpl +++ b/plugins/admin/systems/server.tpl @@ -4,25 +4,34 @@ - + - + +{render acl=$baseACL} + +{/render} + +{render acl=$baseACL disable_picture='images/folder_gray.png'} + +{/render} +
{$must} +{render acl=$cnACL} + +{/render} +
+{render acl=$descriptionACL} + +{/render} +

{$must}

- - {if $baseACL == ""} - - {else} - - {/if} -
@@ -31,9 +40,11 @@ {t}Mode{/t} - {html_options options=$modes selected=$gotoMode} +{/render} @@ -51,10 +62,12 @@
+{render acl=$FAIstateACL} +{/render} -- 2.30.2