From: hickert Date: Wed, 4 Oct 2006 09:10:38 +0000 (+0000) Subject: Added category parameter to tabs. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab58d2af05255a059ab954a81316323a78fef6d0;p=gosa.git Added category parameter to tabs. Added some basic acls functionality to hook acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4848 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index cc94b04f4..b289e0650 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -43,21 +43,12 @@ class faiHook extends plugin /* Load Attributes */ plugin::plugin ($config, $dn); - $this->acl ="#all#"; - /* If "dn==new" we try to create a new entry * Else we must read all objects from ldap which belong to this entry. */ if($dn != "new"){ $this->dn =$dn; - /* Set acls - */ - $ui = get_userinfo(); - $acl = get_permissions ($this->dn, $ui->subtreeACL); - $acli = get_module_permission($acl, "FAIclass", $this->dn); - $this->acl=$acli; - /* Get FAIstate */ if(isset($this->attrs['FAIstate'][0])){ @@ -152,7 +143,8 @@ class faiHook extends plugin $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); } $this->dialog= new $this->subClassName($this->config,$this->dn,$obj); - + $this->dialog->set_acl_base($_SESSION['CurrentMainBase']); + $this->dialog->set_acl_category("fai"); $_SESSION['objectinfo'] = $obj['dn']; $this->dialog->parent = &$this; @@ -175,7 +167,8 @@ class faiHook extends plugin /* Add new sub object */ if(isset($_POST['AddSubObject'])){ $this->dialog= new $this->subClassName($this->config,"new"); - $this->dialog->acl = $this->acl; + $this->dialog->set_acl_base($_SESSION['CurrentMainBase']); + $this->dialog->set_acl_category("fai"); $this->dialog->parent = &$this; $this->is_dialog=true; } @@ -257,7 +250,7 @@ class faiHook extends plugin $divlist = new divSelectBox("FAIhooks"); $divlist->setHeight(400); - if((chkacl($this->acl,"cn")!="") || ($this->FAIstate == "freeze")){ + if($this->FAIstate == "freeze"){ $img_edit = ""; $img_remo = ""; }else{ @@ -297,8 +290,17 @@ class faiHook extends plugin } } - foreach($this->attributes as $attr){ - $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); + $tmp = $this->plInfo(); + $this->ui = get_userinfo(); + + $c_dn = $this->dn; + if($c_dn == "new"){ + $c_dn = $_SESSION['CurrentMainBase']; + } + + $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiScriptEntry")) && $this->FAIstate!="freeze"); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); } $display.= $smarty->fetch(get_template_path('faiHook.tpl', TRUE)); diff --git a/plugins/admin/fai/faiHook.tpl b/plugins/admin/fai/faiHook.tpl index 03e62c361..df968b1cf 100644 --- a/plugins/admin/fai/faiHook.tpl +++ b/plugins/admin/fai/faiHook.tpl @@ -10,7 +10,9 @@ - +{render acl=$cnACL} + +{/render} @@ -20,7 +22,9 @@ - +{render acl=$descriptionACL} + +{/render} @@ -40,7 +44,11 @@ {$Entry_divlist} - +{if $sub_object_is_addable} + +{else} + +{/if} diff --git a/plugins/admin/fai/tabsHook.inc b/plugins/admin/fai/tabsHook.inc index 0a2a6b772..1523398cd 100644 --- a/plugins/admin/fai/tabsHook.inc +++ b/plugins/admin/fai/tabsHook.inc @@ -4,9 +4,9 @@ class tabsHook extends tabs { var $base= ""; - function tabsHook($config, $data, $dn) + function tabsHook($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn,$category); /* Add references/acls/snapshots */ $this->addSpecialTabs(); } diff --git a/plugins/admin/fai/tabsPackage.inc b/plugins/admin/fai/tabsPackage.inc index 57a5c6e96..a7e542c48 100644 --- a/plugins/admin/fai/tabsPackage.inc +++ b/plugins/admin/fai/tabsPackage.inc @@ -4,9 +4,9 @@ class tabsPackage extends tabs { var $base= ""; - function tabsPackage($config, $data, $dn) + function tabsPackage($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn,$category); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/plugins/admin/fai/tabsPartition.inc b/plugins/admin/fai/tabsPartition.inc index a6243aca1..50b6394d7 100644 --- a/plugins/admin/fai/tabsPartition.inc +++ b/plugins/admin/fai/tabsPartition.inc @@ -4,9 +4,9 @@ class tabsPartition extends tabs { var $base= ""; - function tabsPartition($config, $data, $dn) + function tabsPartition($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn,$category); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/plugins/admin/fai/tabsProfile.inc b/plugins/admin/fai/tabsProfile.inc index a51653b2d..5828f7b6e 100644 --- a/plugins/admin/fai/tabsProfile.inc +++ b/plugins/admin/fai/tabsProfile.inc @@ -4,9 +4,9 @@ class tabsProfile extends tabs { var $base= ""; - function tabsProfile($config, $data, $dn) + function tabsProfile($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn,$category); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/plugins/admin/fai/tabsTemplate.inc b/plugins/admin/fai/tabsTemplate.inc index 2b765e05d..ba5e71956 100644 --- a/plugins/admin/fai/tabsTemplate.inc +++ b/plugins/admin/fai/tabsTemplate.inc @@ -4,9 +4,9 @@ class tabsTemplate extends tabs { var $base= ""; - function tabsTemplate($config, $data, $dn) + function tabsTemplate($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn, $category); /* Add references/acls/snapshots */ $this->addSpecialTabs(); diff --git a/plugins/admin/fai/tabsVariable.inc b/plugins/admin/fai/tabsVariable.inc index aca820a3e..ab6707ae6 100644 --- a/plugins/admin/fai/tabsVariable.inc +++ b/plugins/admin/fai/tabsVariable.inc @@ -4,9 +4,9 @@ class tabsVariable extends tabs { var $base= ""; - function tabsVariable($config, $data, $dn) + function tabsVariable($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn, $category); /* Add references/acls/snapshots */ $this->addSpecialTabs();