summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfd0336)
raw | patch | inline | side by side (parent: dfd0336)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 13 Jul 2009 16:07:16 +0000 (16:07 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 13 Jul 2009 16:07:16 +0000 (16:07 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13928 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc | patch | blob | history | |
gosa-plugins/fai/admin/fai/faiDiskEntry.tpl | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
index eee81577275d34b6ba92f5f8ebab094290eb3e3a..03d3e062e0b3b24bca78d59a54294e1efe8d5f62 100644 (file)
var $DISKcn = "";
var $DISKdescription = "";
+ var $DISKFAIdiskOptions = "";
var $partitions = array();
var $UsedAttrs = array();
var $old_cn = "";
var $status = "new";
var $deletePartitions = array();
+ var $fstabkey = "device";
+ var $disklabel = "msdos";
var $FAIstate = "";
/* Set default attributes */
$this->DISKcn = $disk['cn'];
$this->DISKdescription = $disk['description'];
- $this->partitions = $disk['partitions'];
- $this->is_edit = true;
- $this->old_cn = $disk['cn'];
+ $this->partitions = $disk['partitions'];
+ $this->is_edit = true;
+ $this->old_cn = $disk['cn'];
+
+ /* Move faiDiskOption */
+ if (isset($disk['FAIdiskOption'])){
+ foreach($disk['FAIdiskOption'] as $option) {
+ if (preg_match("/fstabkey:(device|label|uuid)/", $option)){
+ $this->fstabkey= preg_replace("/^.*fstabkey:(device|label|uuid).*$/", "$1", $option);
+ break;
+ }
+ if (preg_match("/disklabel:(msdos|gpt)/", $option)){
+ $this->disklabel= preg_replace("/^.*disklabel:(msdos|gpt).*$/", "$1", $option);
+ break;
+ }
+ }
+ } else {
+ $this->fstabkey= "device";
+ }
+
}
}
$s_action = "";
$s_entry = "";
$display = "";
+
+ /* Load parameters */
+ if (isset($_POST['disklabel']) && preg_match("/^(msdos|gpt)$/", $_POST['disklabel'])){
+ $this->disklabel= $_POST['disklabel'];
+ }
+ if (isset($_POST['fstabkey']) && preg_match("/^(device|label|uuid)$/", $_POST['fstabkey'])){
+ $this->fstabkey= $_POST['fstabkey'];
+ }
/* Assign values
* And Checkbox selection
// Fill boxes
$smarty->assign("fstabkeys", array("device" => _("Device"), "label" => _("Label"), "uuid" => _("UUID")));
$smarty->assign("disklabels", array("msdos" => "MSDOS", "gpt" => "GPT"));
- $smarty->assign("fstabkey", "device");
- $smarty->assign("disklabel", "msdos");
+ $smarty->assign("fstabkey", $this->fstabkey);
+ $smarty->assign("disklabel", $this->disklabel);
/* Fetch template and show the result
*/
$tmp['partitions'] = $this->partitions;
$tmp['status'] = $this->status;
+ /* Assemble flags */
+ $tmp['FAIdiskOption'] = array("fstabkey:".$this->fstabkey, "disklabel:".$this->disklabel);
+
/* If hdd name has changed, tell partitionTable to rename it */
if(($this->is_edit)&&($this->old_cn != $this->DISKcn)){
$tmp['rename']['from'] = $this->old_cn;
continue;
}
- if((in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
- $message[]=sprintf(_("please enter a unique mount point for partition %s"),($key));
+ if($part['FAImountPoint'] != "-" && (in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
+ $message[]=sprintf(_("Please enter a unique mount point for partition %s"),($key));
}
if($part['FAIfsType']!="swap" && $part['FAImountPoint'] != "-"){
diff --git a/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl b/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl
index 3de13c88eaf118528c004d81300f18e3551c324b..1dc9916a9b6399bffbfb1cc116d69e7ed4018c20 100644 (file)
</td><td>
{render acl=$DISKFAIdiskOptionACL}
<select name="fstabkey" size="1">
- {html_options values=$fstabkeys output=$fstabkeys selected=$fstabkey}
+ {html_options options=$fstabkeys selected=$fstabkey}
</select>
{/render}
</td>
</td><td>
{render acl=$DISKFAIdiskOptionACL}
<select name="disklabel" size="1">
- {html_options values=$disklabels output=$disklabels selected=$disklabel}
+ {html_options options=$disklabels selected=$disklabel}
</select>
{/render}
</td>