From e6523e6e04a14ff5ca2ebff5dcd7b2080bafa759 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 17 Jul 2008 08:44:01 +0000 Subject: [PATCH] Updated FAI script -Updated ACL handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11697 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/fai/admin/fai/class_faiManagement.inc | 6 +----- gosa-plugins/fai/admin/fai/class_faiScript.inc | 8 +++++--- gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc | 11 ++--------- gosa-plugins/fai/admin/fai/faiScriptEntry.tpl | 2 ++ 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 3e495a9d5..7c08866ca 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -432,13 +432,9 @@ class faiManagement extends plugin $this->dialog = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai"); $this->dialog->parent = &$this; - $this->dialog->by_object[$a_setup[1]]->FAIstate = $entry['FAIstate'];; + $this->dialog->by_object[$a_setup[1]]->FAIstate = $entry['FAIstate']; $this->dialog->set_acl_base($this->dn); $this->is_dialog = true; - - if(preg_match("/^freeze/", $entry['FAIstate']) || $this->no_save){ -# $this->dialog->set_acl_base("freezed") ; - } session::set('objectinfo',$this->dn); } diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 9e33a5d88..dec9e21e7 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -30,7 +30,7 @@ class faiScript extends plugin var $is_dialog = false; // specifies which buttons will be shown to save or abort var $SubObjects = array(); // All leafobjects of this object - var $FAIstate = ""; + var $FAIstate = "branch"; var $sort_by = "name"; var $sort_order = "up"; @@ -156,8 +156,9 @@ class faiScript 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->FAIstate = $this->FAIstate; $this->dialog->set_acl_base($this->acl_base); $this->dialog->set_acl_category("fai"); $this->dialog->parent = &$this; @@ -190,7 +191,7 @@ class faiScript extends plugin } /* Delete script requested */ - if(preg_match("/^deletescript_/",$name)){ + if(preg_match("/^deletescript_/",$name) && preg_match("/freeze/i",$this->FAIstate)){ $s_action = "remove"; $s_entry = preg_replace("/^deletescript_/","",$name); $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); @@ -215,6 +216,7 @@ class faiScript extends plugin /* Create new dialog and set acl attributes */ $this->dialog= new $this->subClassName($this->config,$this->dn,$obj); + $this->dialog->FAIstate = $this->FAIstate; $this->dialog->set_acl_base($this->acl_base_for_current_object($obj['dn'])); $this->dialog->set_acl_category("fai"); diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc index a7a265eb1..91c04d67b 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc @@ -28,11 +28,6 @@ class faiScriptEntry extends plugin $oname = $name; $this->$oname=$value; } - - if(isset($this->attrs['FAIstate'][0])){ - $this->FAIstate = $this->attrs['FAIstate'][0]; - } - }else{ if(is_array($object)&&count($object)){ $this->orig_cn= $object['cn']; @@ -56,6 +51,7 @@ class faiScriptEntry extends plugin /* Fill templating stuff */ $smarty = get_smarty(); + $smarty->assign("freeze", preg_match("/freeze/i",$this->FAIstate)); $display = ""; if(isset($_POST['ImportUpload']) && $this->acl_is_writeable("FAIscript")){ @@ -101,10 +97,7 @@ class faiScriptEntry 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/i",$this->FAIstate)); $smarty->assign($name."ACL",$acl); } diff --git a/gosa-plugins/fai/admin/fai/faiScriptEntry.tpl b/gosa-plugins/fai/admin/fai/faiScriptEntry.tpl index a01b2e776..b25239f91 100644 --- a/gosa-plugins/fai/admin/fai/faiScriptEntry.tpl +++ b/gosa-plugins/fai/admin/fai/faiScriptEntry.tpl @@ -80,7 +80,9 @@
+{if !$freeze}   +{/if}
-- 2.30.2