Code

Added check to partition table entry class - Empt disk names are not allowed.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Jul 2007 09:36:30 +0000 (09:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Jul 2007 09:36:30 +0000 (09:36 +0000)
Start partition index with 1 instead of 0

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6887 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiPartitionTableEntry.inc

index 1b9a5b9dafc578707e400ac3fc4e4b207fbb3960..994d920f0d51c25eee0d390330fa358752e4a72c 100644 (file)
@@ -153,7 +153,12 @@ class faiPartitionTableEntry extends plugin
       $tmp["old_cn"]               = "";     
       $tmp['status']               ="new";
       $tmp['FAIpartitionNr']       = $new_nr;
-      $this->partitions[]=$tmp;
+    
+      if(empty($this->partitions)){
+        $this->partitions[1]=$tmp;
+      }else{
+        $this->partitions[]=$tmp;
+      }
     }
 
     /* $setup contains a table with the partitions. 
@@ -349,6 +354,11 @@ class faiPartitionTableEntry extends plugin
       $alreadyUsed[$attrs] = array();
     }      
 
+    /* Check disk name, to prevent from saving empty names */
+    if(empty($this->DISK_cn)){
+      $message[] = _("Please specify a valid disk name");
+    }
+
     foreach($this->partitions as $key => $part){
   
       /* Skip all checks, if preserve is set */