Code

Followup commit for #774
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_faiPartitionTable.inc
index 07f4ab386798af451d243afc8c6f886daea2af88..391ea168d186e2faac31c1f0779e30c6ca7fd2bd 100644 (file)
@@ -364,6 +364,15 @@ class faiPartitionTable extends plugin
         $message[] = msgPool::duplicated(_("Name"));
       }
     }
+
+    if (preg_match("/^-/", $this->cn)) {
+      $message[] = sprintf(_("The specified classname '%s' is invalid. Classnames must not start with a dash."), $this->cn);
+    }
+
+    if($this->cn != preg_replace("/ /","",trim($this->cn))){
+      $message[] = msgPool::invalid(_("Name"),preg_replace("/ /","_",$this->cn),"/[^_]/");
+    }
+
     return ($message);
   }