Code

Added FAIprofile selection for Workstations
[gosa.git] / plugins / admin / fai / class_faiPartitionTableEntry.inc
index 278b498f634ce95722b27f984787f97df380397b..fea90b82df77a779d89ca53d47a8343dc1e67ef8 100644 (file)
@@ -168,7 +168,7 @@ class faiPartitionTableEntry extends plugin
   {
     /* Define Arrays with allowed syntax */
     $PartitionTypes   = array("primary","logical");
-    $FAIfsTypes       = array("ext2","ext3","xfs","swap","reiserfs","dos fat 16","win fat 32");
+    $FAIfsTypes       = array("ext2","ext3","xfs","swap","reiserfs","dosfat16","winfat32");
 
     /* Display Header */
     $str = "<table style='width:100%'>";
@@ -311,19 +311,23 @@ class faiPartitionTableEntry extends plugin
 
     foreach($this->partitions as $key => $part){
     
-      if(in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint'])){
+      if((in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
         $message[]=sprintf(_("please enter a unique mount point for partition %s"),($key));
       }
 
-      if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){
-        $message[]=sprintf(_("Please enter a valid mount point for partition %s." ),($key));
+      if($part['FAIfsType']!="swap"){
+        if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){
+          $message[]=sprintf(_("Please enter a valid mount point for partition %s." ),($key));
+        }
       }
-
       if($part['FAIfsType'] == "swap"){
         if(in_array($part['FAIfsType'],$alreadyUsed['FAIfsType'])){
           $message[]=sprintf(_("File system type 'swap' is already used, change file system type for partition %s."),$key);
         }
       }
+      if(($part['FAIfsType'] == "swap")&&(!empty($part['FAImountPoint']))&&($part['FAImountPoint']!="swap")){
+        $message[]=_("Please use 'swap' as mount point, if 'swap' is used as fs-type.");
+      }
 
       $tmp = split("-",$part['FAIpartitionSize']);
       switch (count($tmp)){