From: hickert Date: Wed, 4 Oct 2006 04:55:04 +0000 (+0000) Subject: Readded action command to template X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=74d9bea85f13823bb92aefab829258ca1dab2a0c;p=gosa.git Readded action command to template git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4846 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 098cde7ab..215880654 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -199,6 +199,8 @@ class faiManagement extends plugin $attrs = $ldap->fetch(); $type = $this->get_type($attrs); $this->dialog = new $type[0]($this->config, $this->config->data['TABS'][$type[2]], $this->dn); + $this->dialog->set_acl_base($this->dn); + $this->dialog->set_acl_category("fai"); $this->dialog->by_object[$type[1]]->remove_from_parent (); unset ($this->dialog); gosa_log ("FAI class '".$this->dn."' has been tagged as removed"); @@ -240,7 +242,9 @@ class faiManagement extends plugin } add_lock ($this->dn, $this->ui->dn); - $this->dialog = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn); + $this->dialog = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai"); + $this->dialog->set_acl_base($this->dn); +// $this->dialog->set_acl_category("fai"); $this->is_dialog = true; if($entry['FAIstate'] == "freeze"){ diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 18f95aef3..3dd1a5136 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -43,21 +43,12 @@ class faiScript 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. * First read SubObjects from ldap ... and then the partition definitions for the SubObjects. */ if($dn != "new"){ - /* Set acls - */ - $ui = get_userinfo(); - $acl = get_permissions ($this->dn, $ui->subtreeACL); - $acli = get_module_permission($acl, "FAIclass", $this->dn); - $this->acl=$acli; - $this->dn =$dn; /* Get FAIstate @@ -130,7 +121,8 @@ class faiScript 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->is_dialog=true; } @@ -154,6 +146,8 @@ class faiScript 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($this->dn); + $this->dialog->set_acl_category("fai"); $_SESSION['objectinfo'] = $obj['dn']; @@ -179,7 +173,8 @@ class faiScript extends plugin if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){ $script = $_POST['SubObject'][0]; $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$script]); - $this->dialog->acl = $this->acl; + $this->dialog->set_acl_base($_SESSION['CurrentMainBase']); + $this->dialog->set_acl_category("fai"); $_SESSION['objectinfo'] = $this->SubObjects[$script]['dn']; $this->is_dialog=true; } @@ -252,7 +247,7 @@ class faiScript extends plugin */ $divlist = new divSelectBox("FAIscripts"); $divlist->setHeight(400); - if((chkacl($this->acl,"cn")!="") || ($this->FAIstate == "freeze")){ + if(($this->FAIstate == "freeze")){ $img_edit = ""; $img_remo = ""; }else{ @@ -288,8 +283,11 @@ class faiScript extends plugin } } - foreach($this->attributes as $attr){ - $smarty->assign($attr."ACL",chkacl($this->acl,$attr)); + $tmp = $this->plInfo(); + $this->ui = get_userinfo(); + $smarty->assign("sub_object_is_addable", preg_match("/c/",$this->ui->get_permissions($this->dn,"fai/faiScriptEntry"))); + foreach($tmp['plProvidedAcls'] as $name => $translated){ + $smarty->assign($name."ACL",$this->getacl($name)); } $display.= $smarty->fetch(get_template_path('faiScript.tpl', TRUE)); @@ -485,10 +483,8 @@ class faiScript extends plugin "plSection" => array("administration"), "plCategory" => array("fai"), "plProvidedAcls" => array( - "cn" => _("Name"), - "description" => _("Description"), - "FAIpriority" => _("Script priority"), - "FAIscript" => _("FAI script")) + "cn" => _("Name")." ("._("Readonly").")", + "description" => _("Description")) )); } } diff --git a/plugins/admin/fai/class_faiScriptEntry.inc b/plugins/admin/fai/class_faiScriptEntry.inc index 617de2612..2c6bcf070 100644 --- a/plugins/admin/fai/class_faiScriptEntry.inc +++ b/plugins/admin/fai/class_faiScriptEntry.inc @@ -96,12 +96,13 @@ class faiScriptEntry extends plugin $FAIprioritys[$i]=$i; } - foreach($this->attributes as $attr){ - if(($this->FAIstate == "freeze") || (chkacl($this->acl,$attr)!= "")){ - $smarty->assign($attr."ACL"," disabled "); - }else{ - $smarty->assign($attr."ACL"," "); + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translated){ + $acl = $this->getacl($name); + if($this->FAIstate == "freezed"){ + $acl = preg_replace("/w/","",$acl); } + $smarty->assign($name."ACL",$acl); } $smarty->assign("FAIprioritys",$FAIprioritys); @@ -159,6 +160,28 @@ class faiScriptEntry extends plugin $tmp['status'] = $this->status; return($tmp); } + + + /* Return plugin informations for acl handling */ + function plInfo() + { + return (array( + "plShortName" => _("Script entry"), + "plDescription" => _("FAI script entry"), + "plSelfModify" => FALSE, + "plDepends" => array(), + "plPriority" => 0, + "plSection" => array("administration"), + "plCategory" => array("fai"), + "plProvidedAcls" => array( + "cn" => _("Name"), + "description" => _("Description"), + "FAIscript" => _("Script entry"), + "FAIpriority" => _("Script Priority")) + )); + } + + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/fai/faiScript.tpl b/plugins/admin/fai/faiScript.tpl index 420b6afd0..45f7cf25c 100644 --- a/plugins/admin/fai/faiScript.tpl +++ b/plugins/admin/fai/faiScript.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/faiScriptEntry.tpl b/plugins/admin/fai/faiScriptEntry.tpl index ab9c5c152..f3db3d682 100644 --- a/plugins/admin/fai/faiScriptEntry.tpl +++ b/plugins/admin/fai/faiScriptEntry.tpl @@ -9,7 +9,9 @@ {t}Name{/t}{$must}  - +{render acl=$cnACL} + +{/render} @@ -17,7 +19,9 @@ {t}Description{/t}  - +{render acl=$descriptionACL} + +{/render} @@ -35,9 +39,11 @@ - {html_options options=$FAIprioritys selected=$FAIpriority} +{/render} @@ -53,15 +59,23 @@
+{render acl=$FAIscriptACL} +{/render}

-   - +{render acl=$FAIscriptACL} +   +{/render} +{render acl=$FAIscriptACL} + +{/render} +{render acl=$FAIscriptACL} {$DownMe} +{/render}

diff --git a/plugins/admin/fai/tabsScript.inc b/plugins/admin/fai/tabsScript.inc index 69ddfc963..6d7625d3b 100644 --- a/plugins/admin/fai/tabsScript.inc +++ b/plugins/admin/fai/tabsScript.inc @@ -4,9 +4,9 @@ class tabsScript extends tabs { var $base= ""; - function tabsScript($config, $data, $dn) + function tabsScript($config, $data, $dn,$category) { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn,$category); /* Add references/acls/snapshots */ $this->addSpecialTabs();