From 9e62cf55351f48d0d02fc0a2fe75d3383d0f2e21 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 10 Jan 2007 11:58:32 +0000 Subject: [PATCH] Allow "-100324" "12343-" in size field of fai partition table entries. Do not allow spaces within class names. Remember entered class name in "aslclassname" dialog git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5516 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/askClassName.tpl | 2 +- plugins/admin/fai/class_askClassName.inc | 7 ++++++- plugins/admin/fai/class_faiPartitionTableEntry.inc | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/admin/fai/askClassName.tpl b/plugins/admin/fai/askClassName.tpl index 526b6a587..b6a996707 100644 --- a/plugins/admin/fai/askClassName.tpl +++ b/plugins/admin/fai/askClassName.tpl @@ -29,7 +29,7 @@   - {t}Class name{/t}  + {t}Class name{/t}  diff --git a/plugins/admin/fai/class_askClassName.inc b/plugins/admin/fai/class_askClassName.inc index 727e46ca6..8f745151b 100644 --- a/plugins/admin/fai/class_askClassName.inc +++ b/plugins/admin/fai/class_askClassName.inc @@ -110,6 +110,7 @@ class askClassName extends plugin $smarty->assign("grey", ""); } $smarty->assign("ClassNames", $used); + $smarty->assign("ClassName", $this->ClassName); $display.= $smarty->fetch(get_template_path('askClassName.tpl', TRUE)); return($display); } @@ -137,7 +138,11 @@ class askClassName extends plugin { /* Call common method to give check the hook */ $message= plugin::check(); - + + if($this->ClassName != preg_replace("/ /","",trim($this->ClassName))){ + $message[] = _("Spaces are not allowed within class names."); + } + if(empty($this->ClassName)){ $message[]=_("The given class name is empty."); } diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc index 09d85eafb..bf177ed3f 100644 --- a/plugins/admin/fai/class_faiPartitionTableEntry.inc +++ b/plugins/admin/fai/class_faiPartitionTableEntry.inc @@ -393,7 +393,7 @@ class faiPartitionTableEntry extends plugin break; case 2: - if((!is_id($tmp[0]))||(!is_id($tmp[1]))){ + if((!is_id($tmp[0]))&&(!is_id($tmp[1]))){ $message[]=sprintf(_("Please enter a valid range for partition %s."),($key)); }elseif($tmp[0]>=$tmp[1]){ $message[]=sprintf(_("Please enter a valid range for partition %s."),($key)); -- 2.30.2