From: cajus Date: Tue, 27 Nov 2007 16:34:24 +0000 (+0000) Subject: Added encrypted flag for partitions. Closes #285. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=602278883702264796c5bd320b9d439deaf2f8f5;p=gosa.git Added encrypted flag for partitions. Closes #285. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7919 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc index 038e54e47..3059d928e 100644 --- a/plugins/admin/fai/class_faiPartitionTableEntry.inc +++ b/plugins/admin/fai/class_faiPartitionTableEntry.inc @@ -69,6 +69,13 @@ class faiPartitionTableEntry extends plugin $disk['partitions'][$name][$attr]=""; } } + + if (preg_match('/^_/', $disk['partitions'][$name]['FAIfsType'])){ + $disk['partitions'][$name]['FAIfsType']= preg_replace('/^_/', '', $disk['partitions'][$name]['FAIfsType']); + $disk['partitions'][$name]['FAIencrypted']= true; + } else { + $disk['partitions'][$name]['FAIencrypted']= false; + } } } @@ -193,6 +200,7 @@ class faiPartitionTableEntry extends plugin $str .= ""._("Mount options").""; $str .= ""._("FS option").""; $str .= ""._("Preserve").""; + $str .= ""._("Encrypted").""; $str .= " "; $str .= ""; } @@ -283,12 +291,22 @@ class faiPartitionTableEntry extends plugin }else{ $str .= "\n"; } + if($part['FAIencrypted']!=false){ + $str .= "\n"; + }else{ + $str .= "\n"; + } }else{ if($part['FAIpartitionFlags']!=false){ $str .= ""._("False").""; }else{ $str .= ""._("True").""; } + if($part['FAIencrypted']!=false){ + $str .= ""._("False").""; + }else{ + $str .= ""._("True").""; + } } if($this->acl_is_removeable()){ $str .= "\n"; @@ -313,6 +331,10 @@ class faiPartitionTableEntry extends plugin /* Attach partitions */ foreach($this->partitions as $key=>$val) { + if (isset($this->partitions[$key]['FAIencrypted']) && $this->partitions[$key]['FAIencrypted']){ + unset ($this->partitions[$key]['FAIencrypted']); + $this->partitions[$key]['FAIfsType']= "_".$this->partitions[$key]['FAIfsType']; + } $this->partitions[$key]['FAIpartitionNr']=$key; } @@ -355,6 +377,15 @@ class faiPartitionTableEntry extends plugin } } } + + if($this->acl_is_writeable("FAIencrypted")){ + + if(isset($_POST["FAIencrypted_".$key])){ + $this->partitions[$key]["FAIencrypted"] = $_POST["FAIencrypted_".$key]; + }else{ + $this->partitions[$key]["FAIencrypted"] = false; + } + } } } } @@ -472,6 +503,7 @@ class faiPartitionTableEntry extends plugin "FAIpartitionSize" => _("Partition size"), "FAImountOptions" => _("Mount options"), "FAIfsOptions" => _("File system options"), + "FAIencrypted" => _("File system encryption"), "FAIpartitionFlags" => _("Partition flags")) )); }