Code

Followup commit for #774
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_faiTemplate.inc
index b507268f416d1b608ee372a98ea5741e2d21aac1..10c0bd69c5f8a31266939359b8ba5cb8af4c9aea 100644 (file)
@@ -418,6 +418,14 @@ class faiTemplate extends plugin
       }
     }
 
+    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);
   }