summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b5a064)
raw | patch | inline | side by side (parent: 6b5a064)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 30 Jul 2009 08:55:54 +0000 (08:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 30 Jul 2009 08:55:54 +0000 (08:55 +0000) |
-We can save now, but nothing is checked or validated right now.
-Volumes are missing completely right now.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13961 594d385d-05f5-0310-b6e9-bd551577e9d8
-Volumes are missing completely right now.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13961 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 4a656e60cd87658f8ebdbed11e25e1d5a1bde21a..bacf5e123fe57e7273503856fe808d89ce0e300c 100644 (file)
$this->parent = $parent;
$this->UsedAttrs = array("cn","description","FAIpartitionType",
- "FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize",
+ "FAIpartitionNr","FAIfsType","FAImountPoint","FAIpartitionSize","FAIfsTuneOptions",
+ "FAIfsCreateOptions",
"FAImountOptions","FAIfsOptions","FAIpartitionFlags","FAIdiskOption");
/* Set disk type */
foreach($bootable as $bootflag){
$this->partitions[$bootflag]['bootable'] = TRUE;
}
- break;
+ continue;
+ }
+ if (preg_match("/^resize:/", $option)){
+ $resize = split(",", trim(preg_replace("/^resize:/","",$option),","));
+ foreach($resize as $id){
+ $this->partitions[$id]['resize'] = TRUE;
+ }
+ continue;
+ }
+ if (preg_match("/^preserve_always:/", $option)){
+ $preserve = split(",", trim(preg_replace("/^preserve_always:/","",$option),","));
+ foreach($preserve as $presflag){
+ $this->partitions[$presflag]['preserve'] = TRUE;
+ $this->partitions[$presflag]['preserveType'] = 'always';
+ }
+ continue;
+ }
+ if (preg_match("/^preserve_reinstall:/", $option)){
+ $preserve = split(",", trim(preg_replace("/^preserve_reinstall:/","",$option),","));
+ foreach($preserve as $presflag){
+ $this->partitions[$presflag]['preserve'] = TRUE;
+ $this->partitions[$presflag]['preserveType'] = 'reinstall';
+ }
+ continue;
}
}
} else {
$tmp['rename']['from'] = $this->old_cn;
$tmp['rename']['to'] = $this->DISKcn;
}
+
+ // Build up disk options
+ $bootable = "";
+ $resize = "";
+ $preserve_always = "";
+ $preserve_reinstall = "";
+
+ foreach($tmp['partitions'] as $id => $part){
+ if(isset($part['bootable']) && $part['bootable']){
+ $bootable .= $id.",";
+ }
+ if(isset($part['resize']) && $part['resize']){
+ $resize .= $id.",";
+ }
+ if(isset($part['preserve']) && $part['preserve']){
+ if($part['preserveType'] == "always"){
+ $preserve_always .= $id.",";
+ }else{
+ $preserve_reinstall .= $id.",";
+ }
+ }
+ $tmp['partitions'][$id]['status'] = $part['status'];
+
+ // Unset non valid attributes
+ foreach(array("bootable","encrypted","preserve","preserveType","resize","FAIdiskType") as $attr){
+ if(isset($tmp['partitions'][$id][$attr])){
+ unset($tmp['partitions'][$id][$attr]);
+ }
+ }
+ }
+
+ if(!empty($bootable)){
+ $tmp['FAIdiskOption'][] = "bootable:".trim($bootable,",");
+ }
+ if(!empty($resize)){
+ $tmp['FAIdiskOption'][] = "resize:".trim($resize,",");
+ }
+ if(!empty($preserve_always)){
+ $tmp['FAIdiskOption'][] = "preserve_always:".trim($preserve_always,",");
+ }
+ if(!empty($preserve_reinstall)){
+ $tmp['FAIdiskOption'][] = "preserve_reinstall:".trim($preserve_reinstall,",");
+ }
+
+ $tmp['status'] = $this->status;
return($tmp);
}
}
foreach($this->UsedAttrs as $attrs){
- $alreadyUsed[$attrs][$key] = $part[$attrs];
+ if(isset($part[$attrs])){
+ $alreadyUsed[$attrs][$key] = $part[$attrs];
+ }
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index c6c901e2d9e37ed8ed897bd177299f7e14a25db1..72942a65d14017215293efe93711ec7b29772861 100644 (file)
var $preserveType = "always";
var $encrypted = false;
+ var $status = "";
var $raidDevices = array();
function __construct($config, $object, $parent,$type)
}
}
+ $this->status = $object['status'];
$this->FAIdiskType = $type;
if($type == "disk"){
$this->FAIpartitionSizeType = "remaining";
}
+
+ /* Check for encrypted partitions
+ */
+ if(preg_match("/:encrypt$/",$this->FAImountPoint)){
+ $this->FAImountPoint = preg_replace("/:encrypt/","",$this->FAImountPoint);
+ $this->encrypted = TRUE;
+ }
+
}elseif($type == "raid"){
$usedDisks = split(",",$this->FAIpartitionSize);
"xfs" => _("Xfs"),
"btrfs" => _("Btrfs"));
-
-
-
$smarty->assign("partitionTypes", $types);
$smarty->assign("partitionSizeTypes", $partitionSizeTypes);
$smarty->assign("FAIpartitionSizeType", $this->FAIpartitionSizeType);
$ret['FAIpartitionSize'] = "-";break;
default: trigger_error("Unknown partition size!");
}
+
+ // Add encryption flag to partition mount point
+ if($this->encrypted){
+ $ret['FAImountPoint'] .= ":encrypt";
+ }
+
}elseif($this->FAIdiskType == "raid"){
$ret['FAIpartitionSize'] = "";
foreach($this->raidDevices as $device){
}
$ret['FAIpartitionSize'] = trim($ret['FAIpartitionSize'],",");
}
+ $ret['status'] = $this->status;
return($ret);
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 2890e2ead70ef1be1179aabf2510e2240802c8f4..8c0a4d533e6405a8fccbbd86093311ccc1143379 100644 (file)
var $objectclasses = array("top","FAIclass","FAIpartitionTable");
var $subAttributes = array("cn","description");
- var $subPartAttributes = array("cn","FAIpartitionNr","FAIpartitionSize","FAImountPoint","FAIfsType","FAIpartitionType","FAImountOptions","FAIfsOptions","FAIpartitionFlags","description");
+ var $subPartAttributes = array("cn","FAIpartitionNr","FAIpartitionSize","FAImountPoint","FAIfsType","FAIpartitionType","FAImountOptions","FAIfsOptions","FAIpartitionFlags","description","FAIfsCreateOptions","FAIfsTuneOptions");
var $sub64coded = array();
var $subBinary = array();
if(isset($disk['FAIdiskType'])){
$disk_attrs['FAIdiskType'] = $disk['FAIdiskType'];
}
+ if(isset($disk['FAIdiskOption'])){
+ $disk_attrs['FAIdiskOption'] = $disk['FAIdiskOption'];
+ }
if(empty($disk_attrs['description']) && $disk['status'] == "edited"){
$disk_attrs['description'] = array();
}
if($disk['status']!="delete")
+
/* Add all partitions */
foreach($disk['partitions'] as $key => $partition){
$partition_attrs = array();
diff --git a/gosa-plugins/fai/admin/fai/faiPartition.tpl b/gosa-plugins/fai/admin/fai/faiPartition.tpl
index a6f8536e444711b2a8424af61aead6150d42acb2..34d78945b1fcdf4f5aad6eabfde4e7949ae588ec 100644 (file)
<input name="FAIpartitionType" value="{$FAIpartitionType}">
</td>
{else}
- <td>{t}Name{/t}</td>
+ <td>{t}Type{/t}</td>
<td>
<select name="FAIpartitionType" onChange='document.mainform.submit();'>
{html_options options=$partitionTypes selected=$FAIpartitionType}
</td>
<td>
<select name='preserveType'>
- {html_options options=preserveType selected=$preserveType}
+ {html_options options=$preserveTypes selected=$preserveType}
</select>
</td>
</tr>