From 540e2d8a95940af85276d8a01e56ee329b5f2ddf Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 7 Aug 2009 08:41:59 +0000 Subject: [PATCH] Updated FAI partition stuff -Do not allow to edit the new style partitions when they are freezed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13996 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_faiDiskEntry.inc | 16 ++++++++--- .../fai/admin/fai/class_faiPartition.inc | 1 + .../fai/admin/fai/class_faiPartitionTable.inc | 28 +++++++++---------- gosa-plugins/fai/admin/fai/faiPartition.tpl | 2 ++ 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc index 577a2365b..2975fe0c0 100644 --- a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc @@ -530,10 +530,18 @@ class faiDiskEntry extends plugin $opt =array( "string" => "".preg_replace('/, $/',"",$opt).""); - $action =array( - "string" => "". - "", - "attach" => "style='width:40px; border-right: 0px;'"); + if(!preg_match("/freeze/", $this->FAIstate)){ + $action =array( + "string" => "". + "", + "attach" => "style='width:40px; border-right: 0px;'"); + }else{ + $action =array( + "string" => "", + "attach" => "style='width:40px; border-right: 0px;'"); + } + + if($this->FAIdiskType == "lvm"){ $fields = array($cn,$desc,$mntp,$opt,$size, $action); diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc index e0ecbd3b2..a6b5ed8ff 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartition.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartition.inc @@ -212,6 +212,7 @@ class faiPartition extends plugin $smarty->assign("FAIfsTypes", $FAIfsTypes); $smarty->assign("cn", $this->cn); + $smarty->assign("freeze", preg_match("/freeze/i",$this->parent->FAIstate)); $smarty->assign("plist",$this->getRaidlist()); $smarty->assign("physicalPartitionList",$this->getPartitionlist()); diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index d40bb8215..4f3c269aa 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -170,20 +170,18 @@ class faiPartitionTable extends plugin } /* New Listhandling */ - if (!preg_match("/freeze/i", $this->FAIstate)){ - foreach($_POST as $name => $value){ - if(preg_match("/^edit_[^_]*_/",$name)){ - $s_entry = preg_replace("/^edit_/","",$name); - $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); - $s_action = "edit"; - break; - } - if(preg_match("/^delete_[^_]*_/",$name)){ - $s_entry = preg_replace("/^delete_/","",$name); - $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); - $s_action = "remove"; - break; - } + foreach($_POST as $name => $value){ + if(preg_match("/^edit_[^_]*_/",$name)){ + $s_entry = preg_replace("/^edit_/","",$name); + $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); + $s_action = "edit"; + break; + } + if (!preg_match("/freeze/i", $this->FAIstate) && preg_match("/^delete_[^_]*_/",$name)){ + $s_entry = preg_replace("/^delete_/","",$name); + $s_entry = base64_decode(preg_replace("/_.*/","",$s_entry)); + $s_action = "remove"; + break; } } @@ -411,7 +409,7 @@ class faiPartitionTable extends plugin if($disk['status'] != "delete"){ $act .= ""; - if(preg_match("/d/",$acl)){ + if(preg_match("/d/",$acl) && !preg_match("/freeze/", $this->FAIstate)){ $act .=""; } diff --git a/gosa-plugins/fai/admin/fai/faiPartition.tpl b/gosa-plugins/fai/admin/fai/faiPartition.tpl index fc2da49fd..7e63d61c1 100644 --- a/gosa-plugins/fai/admin/fai/faiPartition.tpl +++ b/gosa-plugins/fai/admin/fai/faiPartition.tpl @@ -178,7 +178,9 @@

 

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