From: hickert Date: Wed, 22 Aug 2007 12:15:33 +0000 (+0000) Subject: Do not allow FAIprofile names that are already used by some other FAIobjects. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6001a4c1306cee3725c0c317bfe0237fc5a54569;p=gosa.git Do not allow FAIprofile names that are already used by some other FAIobjects. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7114 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_askClassName.inc b/plugins/admin/fai/class_askClassName.inc index 422716a13..f3546d304 100644 --- a/plugins/admin/fai/class_askClassName.inc +++ b/plugins/admin/fai/class_askClassName.inc @@ -56,7 +56,7 @@ class askClassName extends plugin foreach($res2 as $object){ /* skip class names with this name */ - if(in_array($this->objectClass,$object['objectClass'])){ + if(in_array($this->objectClass,$object['objectClass']) || in_array("FAIprofile",$object['objectClass'])){ $delete[] = $object['cn'][0]; } diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index e9b59675f..84e5b40b1 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -390,7 +390,7 @@ class faiProfile extends plugin $dn = 'cn='.$this->cn.",ou=profiles,".$this->release; $ldap = $this->config->get_ldap_link(); $ldap->cat($dn); - if($ldap->count()){ + if($ldap->count() || in_array($this->cn,$this->FAIAllclasses)){ $r =convert_department_dn($this->release);; $message[] = sprintf(_("Can't insert a script named '%s' in '%s' there is already a script with the given name."),$this->cn,$r); @@ -416,8 +416,8 @@ class faiProfile extends plugin } else { $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*")); } - if($ldap->count()){ - $message[]=_("There is already a profile with this class name defined."); + if($ldap->count() || isset($this->FAIAllclasses[$this->cn])){ + $message[]=_("There is already a FAI object with this class name defined."); } } return ($message);