Commit df7a7f5f authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3150 faiprofile edition was broken

parent 6e0d9150
......@@ -410,11 +410,11 @@ class faiProfile extends faiPluginClass
$message[]=_("No class specified for this profile!");
}
if($this->cn == ""){
$message[]= msgPool::required(_("Name"));
if ($this->cn == "") {
$message[] = msgPool::required(_("Name"));
} elseif (empty($message)) {
/* Profile can't use a name used by a class */
$res = FAI::get_all_objects_for_given_base($this->parent->parent->fai_release, "(cn=".$this->cn.")");
$res = FAI::get_all_objects_for_given_base($this->parent->parent->fai_release, "(&(!(objectClass=faiProfile))(cn=".$this->cn."))");
if (!empty($res)) {
$message[] = _("You can't use the same name for a class and a profile!");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment