From: hickert Date: Tue, 28 Jul 2009 12:06:38 +0000 (+0000) Subject: Partition changes. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=403ea739ee4c20b191a2bd51a3a52e468266e1b6;p=gosa.git Partition changes. -Uh that stuff is a bit confusing - just a commit of my changes. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13956 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc index 19f85219c..69253f5fe 100644 --- a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc @@ -207,6 +207,28 @@ class faiDiskEntry extends plugin function generateParts() { + + $divlist = new divSelectBox("DiskEntries"); + foreach($this->partitions as $key => $part){ + + + $number =array("string" => $part['FAIpartitionNr']); + $size =array("string" => $part['FAIpartitionSize']); + $mntp =array("string" => $part['FAImountPoint']); + $fstype =array("string" => $part['FAIfsType']); + $type =array("string" => $part['FAIpartitionType']); + + $desc =array("string" => $part['description']); + $opt =array("string" => $part['FAImountOptions']); + $fsopt =array("string" => $part['FAIfsOptions']); + $flags =array("string" => $part['FAIpartitionFlags']); + + + $fields = array($number,$mntp,$size,$fstype,$type); + $divlist->AddEntry($fields); + } + return($divlist->DrawList()); + /* Define Arrays with allowed syntax */ $PartitionTypes = array("primary"=>_("primary"),"logical"=>_("logical")); $FAIfsTypes = array("ext2","ext3","xfs","swap","reiser","dosfat16","winfat32"); diff --git a/gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc b/gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc index 23ae1066c..bc15c3d5c 100644 --- a/gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiLvmEntry.inc @@ -26,8 +26,9 @@ class faiLvmEntry extends plugin function __construct (&$config, $dn= NULL,$usedDiskNames=array(),$disk=false) { plugin::plugin ($config, $dn); - $this->UsedAttrs = array("cn","description","FAIpartitionType","FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize", - "FAImountOptions","FAIfsOptions","FAIpartitionFlags"); + $this->UsedAttrs = array("cn","description","FAIpartitionType", + "FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize", + "FAImountOptions","FAIfsOptions","FAIpartitionFlags"); /* Default status is new */ $this->status = "new"; @@ -35,7 +36,7 @@ class faiLvmEntry extends plugin /* We want to edit an entry */ if($disk){ - /* Set disk status */ + /* Set disk status, eg removed. */ $this->status = $disk['status']; /* Walk through partitions */ @@ -97,7 +98,6 @@ class faiLvmEntry extends plugin } else { $this->fstabkey= "device"; } - } } @@ -198,10 +198,14 @@ class faiLvmEntry extends plugin $smarty->assign("disklabels", array("msdos" => "MSDOS", "gpt" => "GPT")); $smarty->assign("fstabkey", $this->fstabkey); $smarty->assign("disklabel", $this->disklabel); + + // Create divlist + $divlist = new divSelectBox("lvmDisks"); + $smarty->assign("clist", $this->generateParts().$divlist->DrawList()); /* Fetch template and show the result */ - $display.= $smarty->fetch(get_template_path('faiDiskEntry.tpl', TRUE)); + $display.= $smarty->fetch(get_template_path('faiLvmEntry.tpl', TRUE)); return($display); } diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index 866ff64a2..8146b5cfe 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -283,16 +283,35 @@ class faiPartitionTable extends plugin $dn = "new"; } - if ($this->FAIpartitionMethod == "setup-storage") { - $this->dialog = new faiDiskEntry($this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); - } else { - $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + if(isset($this->disks[$Udisk]['FAIdiskType'])){ + switch($this->disks[$Udisk]['FAIdiskType']){ + case 'raid': + $this->dialog = new faiRaidEntry( + $this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + break; + case 'lvm': + $this->dialog = new faiLvmEntry( + $this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + break; + case 'disk': + $this->dialog = new faiDiskEntry( + $this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + break; + case 'old': + $this->dialog = new faiPartitionTableEntry( + $this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + break; + } + }else{ + $this->dialog = new faiPartitionTableEntry( + $this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + } + if($this->dialog){ + $this->dialog->set_acl_base($this->acl_base_for_current_object($dn)); + $this->dialog->set_acl_category("fai"); + $this->dialog->FAIstate = $this->FAIstate; + $this->is_dialog = true; } - $this->dialog->set_acl_base($this->acl_base_for_current_object($dn)); - $this->dialog->set_acl_category("fai"); - $this->dialog->FAIstate = $this->FAIstate; - - $this->is_dialog = true; } } diff --git a/gosa-plugins/fai/admin/fai/faiLvmEntry.tpl b/gosa-plugins/fai/admin/fai/faiLvmEntry.tpl new file mode 100644 index 000000000..36783fbe4 --- /dev/null +++ b/gosa-plugins/fai/admin/fai/faiLvmEntry.tpl @@ -0,0 +1,75 @@ + + +

+  {t}Device{/t} +

+ + + + + +
+ + + + + + + + + + +
+ {$must}  + +{render acl=$DISKcnACL} + +{/render} +
+ + +{render acl=$DISKFAIdiskOptionACL} + +{/render} +
+
+ + + + + +
+   + +{render acl=$DISKdescriptionACL} + +{/render} +
+
+
+

 

+

{t}Combined partitions{/t}

+ +{$clist} + +
+

 

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