From ef8595a84374f8199ee1ce21717b9ca853c772c9 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 17 Jul 2007 09:36:30 +0000 Subject: [PATCH] Added check to partition table entry class - Empt disk names are not allowed. 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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc index 1b9a5b9da..994d920f0 100644 --- a/plugins/admin/fai/class_faiPartitionTableEntry.inc +++ b/plugins/admin/fai/class_faiPartitionTableEntry.inc @@ -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 */ -- 2.30.2