From 27ad74f155f9d9ddcc9d4b92d0036c883553c3d2 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 17 Jul 2008 09:35:47 +0000 Subject: [PATCH] Updated FAI variable - Fixed ACLs and freezed object handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11700 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiVariable.inc | 18 +++++++----------- .../fai/admin/fai/class_faiVariableEntry.inc | 14 +++----------- .../fai/admin/fai/faiVariableEntry.tpl | 2 ++ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index 377f3ee38..22fa65001 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -40,12 +40,6 @@ class faiVariable extends plugin if($dn != "new"){ $this->dn =$dn; - /* Get FAIstate - */ - if(isset($this->attrs['FAIstate'][0])){ - $this->FAIstate = $this->attrs['FAIstate'][0]; - } - /* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry) */ $ldap = $this->config->get_ldap_link(); @@ -118,11 +112,12 @@ class faiVariable extends plugin $display= ""; /* Add new sub object */ - if(isset($_POST['AddSubObject'])){ + if(isset($_POST['AddSubObject']) && !preg_match("/freeze/i",$this->FAIstate)){ $this->dialog= new $this->subClassName($this->config,"new"); $this->dialog->set_acl_base($this->acl_base_for_current_object($this->dn)); $this->dialog->set_acl_category("fai"); $this->dialog->parent = &$this; + $this->dialog->FAIstate = $this->FAIstate; $this->is_dialog=true; } @@ -139,13 +134,14 @@ class faiVariable extends plugin $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$var]); $this->dialog->set_acl_category("fai"); $this->dialog->set_acl_base($c_dn); + $this->dialog->FAIstate = $this->FAIstate; $this->dialog->parent = &$this; session::set('objectinfo',$this->SubObjects[$var]['dn']); $this->is_dialog=true; } /* Remove Sub object */ - if((isset($_POST['DelSubObject']))&&(isset($_POST['SubObject']))){ + if((isset($_POST['DelSubObject']))&&(isset($_POST['SubObject'])) && !preg_match("/freeze/i",$this->FAIstate)){ foreach($_POST['SubObject'] as $var){ $c_dn = $this->acl_base_for_current_object($this->SubObjects[$var]['dn']); @@ -161,7 +157,7 @@ class faiVariable extends plugin } /* Save Dialog */ - if(isset($_POST['SaveSubObject'])){ + if(isset($_POST['SaveSubObject']) && !preg_match("/freeze/i",$this->FAIstate)){ $this->dialog->save_object(); $msgs = $this->dialog->check(); if(count($msgs)>0){ @@ -237,12 +233,12 @@ class faiVariable extends plugin } $c_dn = $this->acl_base_for_current_object($this->dn); - $smarty->assign("is_createable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && !preg_match("/freeze/", $this->FAIstate)); + $smarty->assign("is_createable", preg_match("/c/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && !preg_match("/freeze/", $this->FAIstate)); $smarty->assign("is_removeable", preg_match("/d/",$this->ui->get_permissions($c_dn,"fai/faiVariableEntry")) && !preg_match("/freeze/", $this->FAIstate)); $tmp = $this->plInfo(); foreach($tmp['plProvidedAcls'] as $name => $translation) { - $smarty->assign($name."ACL",$this->getacl($name)); + $smarty->assign($name."ACL",$this->getacl($name,preg_match("/freeze/i",$this->FAIstate))); } diff --git a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc index 50e734820..a60d10e22 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc @@ -26,11 +26,6 @@ class faiVariableEntry extends plugin $oname = $name; $this->$oname=addslashes($value); } - - if(isset($this->attrs['FAIstate'][0])){ - $this->FAIstate = $this->attrs['FAIstate'][0]; - } - }else{ $this->status = "new"; $this->orig_cn = false; @@ -59,19 +54,16 @@ class faiVariableEntry extends plugin $tmp = $this->plInfo(); foreach($tmp['plProvidedAcls'] as $name => $translated){ - $acl = $this->getacl($name); - if($this->FAIstate == "freezed"){ - $acl = preg_replace("/w/","",$acl); - } + $acl = $this->getacl($name, preg_match("/freeze/",$this->FAIstate)); $smarty->assign($name."ACL",$acl); } - - + $smarty->assign("freeze",preg_match("/freeze/",$this->FAIstate)); $display.= $smarty->fetch(get_template_path('faiVariableEntry.tpl', TRUE)); return($display); } + /* Save data to object */ function save_object() { diff --git a/gosa-plugins/fai/admin/fai/faiVariableEntry.tpl b/gosa-plugins/fai/admin/fai/faiVariableEntry.tpl index f044cc5be..e69797718 100644 --- a/gosa-plugins/fai/admin/fai/faiVariableEntry.tpl +++ b/gosa-plugins/fai/admin/fai/faiVariableEntry.tpl @@ -51,7 +51,9 @@

 


+{if !$freeze}   +{/if}
-- 2.30.2