Code

Do not allow FAIprofile names that are already used by some other FAIobjects.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Aug 2007 12:15:33 +0000 (12:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Aug 2007 12:15:33 +0000 (12:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7114 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_askClassName.inc
plugins/admin/fai/class_faiProfile.inc

index 422716a13ab4f2874c53fdb9d2cccb230887a919..f3546d304272f190d8565d4a643d5a0b2a38ff7c 100644 (file)
@@ -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];
         }
     
index e9b59675fe583568bf80df95c71d288fcec7b878..84e5b40b1174dc503303d66235f18985c104ea0c 100644 (file)
@@ -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);