From: hickert Date: Thu, 31 Aug 2006 05:40:48 +0000 (+0000) Subject: Added ogroup acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c410b9d1ae522912520874bb30aa1f581753b708;p=gosa.git Added ogroup acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4549 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 9a220b980..3243c5855 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -85,12 +85,6 @@ class ogroup extends plugin $this->base = $_SESSION['CurrentMainBase']; } - /* set permissions */ - $ui= get_userinfo(); - $acl= get_permissions ($ui->dn, $ui->subtreeACL); - $this->acl= get_module_permission($acl, "ogroup", $ui->dn); - - /* Load member data */ $this->reload(); } @@ -176,6 +170,12 @@ class ogroup extends plugin /* Load templating engine */ $smarty= get_smarty(); + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + + /* Base select dialog */ $once = true; foreach($_POST as $name => $value){ @@ -312,12 +312,6 @@ class ogroup extends plugin /* Fields */ foreach ($this->attributes as $val){ $smarty->assign("$val", $this->$val); - $smarty->assign("$val"."ACL", chkacl($this->acl, "$val")); - } - - /* Assign ACL's */ - foreach (array("base", "members") as $val){ - $smarty->assign("$val"."ACL", chkacl($this->acl, "$val")); } return ($smarty->fetch (get_template_path('generic.tpl', TRUE))); @@ -330,11 +324,6 @@ class ogroup extends plugin /* Save additional values for possible next step */ if (isset($_POST['ogroupedit'])){ plugin::save_object(); - - if (chkacl ($this->acl, "base") == "" && isset($_POST["base"])){ - $this->base= $_POST["base"]; - } - } } @@ -649,15 +638,13 @@ class ogroup extends plugin $message[]= _("There is already an object with this cn."); } - $ui= get_userinfo(); - $acl= get_permissions ($new_dn, $ui->subtreeACL); - $acl= get_module_permission($acl, "group", $new_dn); - if (chkacl($acl, "create") != ""){ + print_a($this); + if ($this->acl_is_createable()){ $message[]= _("You have no permissions to create a group on this 'Base'."); } /* must: cn */ - if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){ + if ($this->cn == "" && $this->acl_is_writeable("cn")){ $message[]= "The required field 'Name' is not set."; } @@ -760,6 +747,7 @@ class ogroup extends plugin "objectClass" => "gosaGroupOfNames")), "plProvidedAcls"=> array( "cn" => _("Name"), + "base" => _("Base"), "description" => _("Description"), "member" => _("Member")) )); diff --git a/plugins/admin/ogroups/generic.tpl b/plugins/admin/ogroups/generic.tpl index 182f28ec3..2585d2c8c 100644 --- a/plugins/admin/ogroups/generic.tpl +++ b/plugins/admin/ogroups/generic.tpl @@ -6,12 +6,17 @@ {$must} - +{render acl=$cnACL} + +{/render} - + +{render acl=$descriptionACL} + +{/render} @@ -20,14 +25,14 @@ {$must} - {html_options options=$bases selected=$base_select} - {if $baseACL==""} - - {else} - - {/if} +{/render} +{render acl=$baseACL disable_picture='images/folder_gray.png'} + +{/render} @@ -36,12 +41,18 @@  ({$combinedObjects})
- {$members} +{/render}
-   - +{render acl=$memberACL} +   +{/render} +{render acl=$memberACL} + +{/render}