Code

Followup commit for #774
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / class_faiProfile.inc
index e146a9121644060ea1327408aa72eb8d7ab4d366..da3d9192953537ffa00f698ec45b8682fe3b30d3 100644 (file)
@@ -424,6 +424,14 @@ class faiProfile 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);
   }