Code

Followup commit for #774
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_faiPackage.inc
index ebc2e96640b8d9cb5307ff0e8a0252359a5ebe6c..fb7ad0902621e56bc79161da4b2d2e330ecb04ff 100644 (file)
@@ -603,6 +603,15 @@ class faiPackage 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);
   }