summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0532fea)
raw | patch | inline | side by side (parent: 0532fea)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Aug 2008 11:59:39 +0000 (11:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Aug 2008 11:59:39 +0000 (11:59 +0000) |
-... to support 0 as object names too.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12208 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12208 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/fai/admin/fai/class_askClassName.inc b/gosa-plugins/fai/admin/fai/class_askClassName.inc
index e409a868f98ac9015aad5d11f8a6ad9d90ddf2b5..fedbbfa62c2bab03ec67dffbe1ae1a52e5498bba 100644 (file)
$message[] = msgPool::invalid(_("Name"),preg_replace("/ /","_",$this->ClassName),"/[^_]/");
}
- if(empty($this->ClassName)){
+ if($this->ClassName == ""){
$message[]= msgPool::required(_("Name"));
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc
index 9ae982c296160c1899921f16445f58ffd9faa6cc..141fc5e3d7ba9bb7f94137ebb870736e1a6ef890 100644 (file)
$tmp = array();
$attributes = array_merge($this->sub_Load_Later,$this->subAttributes);
foreach($attributes as $attrs){
- if(empty($obj[$attrs])){
+ if($obj[$attrs] == ""){
$obj[$attrs] = array();
}
if(!is_array($obj[$attrs])){
diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
index 2fcff5700f066bb83405e6d4f740d552236d8506..d258586bc0f096d64668330c74745186ceb0bb65 100644 (file)
$message[]= msgPool::duplicated(_("Name"));
}
- if(empty($this->FAIscript)) {
- $message[]= msgPool::required(_("Script"));
+ $c = trim($this->cn);
+ if($c == ""){
+ $message[] = msgPool::required(_("Name"));
+ }
+ if(preg_match("/[^a-z0-9_\-]/i",$c)){
+ $message[] = msgPool::invalid(_("Name"),$c,"/[a-z0-9_\-]/i");
}
- if(empty($this->cn)){
- $message[]= msgPool::required(_("Name"));
+ $s = trim($this->FAIscript);
+ if($s == ""){
+ $message[]= msgPool::required(_("Script"));
}
return ($message);
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc
index caee87bdd1f8f11b96101faebfb6a5fb736612ac..0efc24c103d918707367f568079cf81cc2846e8c 100644 (file)
$message= plugin::check();
/* Check for an empty disk name */
- if(empty($this->DISKcn)){
+ $d = trim($this->DISKcn);
+ if($d == "" ){
$message[] = msgPool::required(_("Name"));
}
+ if(preg_match("/[^a-z0-9_\-]/i",$d)){
+ $message[] = msgPool::invalid(_("Name"),$d,"/[a-z0-9_\-]/i");
+ }
/* check every partition.
* if there is an invalid value defined, append an errorstr to message
diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc
index 130c00b655d9b208b1df4c786ef294b2fe965801..601b2f1b2dfb296c33990d8753b0d5603dd82355 100644 (file)
$message[]=_("No class specified for this profile!");
}
- if(empty($this->cn)){
- $message[]= msgPool::invalid(_("Name"));
+ if($this->cn == ""){
+ $message[]= msgPool::required(_("Name"));
}
/* Ensure that we do not overwrite an allready existing entry
diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc
index a76e749ebee431a1e283de37efece9d7b05770a2..fe28af277f9940572a0ab65e8f1a0687cddb5a26 100644 (file)
$attributes = array_merge($this->sub_Load_Later,$this->subAttributes);
foreach($attributes as $attrs){
- if(empty($obj[$attrs])){
+ if($obj[$attrs] == ""){
$obj[$attrs] = array();
}
if(!is_array($obj[$attrs])){
diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc
index 91c04d67bfba5905f459772c6d4c756ed264bb56..2667a0de137aebb284d7b18aafdc7723ae9027c9 100644 (file)
$message[] = msgPool::duplicated(_("Name"));
}
- if(empty($this->cn)){
+ $c = trim($this->cn);
+ if($c == ""){
$message[] = msgPool::required(_("Name"));
}
+ if(preg_match("/[^a-z0-9_\-]/i",$c)){
+ $message[] = msgPool::invalid(_("Name"),$c,"/[a-z0-9_\-]/i");
+ }
- if(empty($this->FAIscript)){
+ $s = trim($this->FAIscript);
+ if($s == ""){
$message[]= msgPool::required(_("Script"));
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
index acff161996f4c5d2444a5821d994d949894e58e2..7b5b94890c6084bf9bf32f385f418473f6a8a8d4 100644 (file)
$tmp = array();
$attributes = array_merge($this->sub_Load_Later,$this->subAttributes);
foreach($attributes as $attrs){
- if(empty($obj[$attrs])){
+ if($obj[$attrs] == ""){
$obj[$attrs] = array();
}
$tmp[$attrs] =($obj[$attrs]);
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc
index 5a4ab856b54f5b6ddaaba8496f536f548f0c5fac..b71bf4bce40672b82c6cba1f9605709ee4f2e409 100644 (file)
$message[]= msgPool::invalid(_("Destination path"),"","","/path");
}
- $b = basename($this->FAItemplatePath);
- if(empty($b)){
+ $b = trim(basename($this->FAItemplatePath));
+ if($b == ""){
$message[] = msgPool::required(_("File name"));
}
- if(empty($this->user)){
+ if($this->user == ""){
$message[] = msgPool::required(_("User"));
- }
- elseif(preg_match("/[^0-9a-z]/i",$this->user)){
+ }elseif(preg_match("/[^0-9a-z]/i",$this->user)){
$message[] = msgPool::invalid(_("User"),$this->user,"/[0-9a-z]/");
}
- if(empty($this->group)){
+ if($this->group == ""){
$message[] = msgPool::required(_("Group"));
- }
- elseif (!tests::is_uid($this->group)){
+ }elseif (!tests::is_uid($this->group)){
if (strict_uid_mode()){
$message[]= msgPool::invalid(_("Group"), $this->group, "/[a-z0-9_-]/");
} else {
diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc
index 1ace86d1b5a4bebbfc1d125d2ce2099f5e3daf0c..c915d1f41b0486ae499b19df1b98b3d47167a4d3 100644 (file)
$tmp = array();
foreach($this->subAttributes as $attrs){
- if(empty($obj[$attrs])){
+ if($obj[$attrs] == ""){
$obj[$attrs] = array();
}
$tmp[$attrs] = $obj[$attrs];
diff --git a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc
index 5ee011c4481d218708c9d8186b8d39bee13eafe8..dd88739559bbda247393bf731682347c82ecd506 100644 (file)
if($this->FAIvariableContent == "") {
$message[]= msgPool::required(_("Content"));
}
-
- if(empty($this->cn)){
+
+ $c = trim($this->cn);
+ if($c == ""){
$message[] = msgPool::required(_("Name"));
}
+ if(preg_match("/[^a-z0-9_\-]/i",$c)){
+ $message[] = msgPool::invalid(_("Name"),$c,"/[a-z0-9_\-]/i");
+ }
return ($message);
}