Code

Followup commit for #774
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_faiHook.inc
index 5939f7eaa0e88875a4e45799153f70b4024ae914..d68429bc0d087dbd8f7d1434e1ccd506f847bcac 100644 (file)
@@ -435,6 +435,14 @@ class faiHook 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);
   }