Code

Updated FAI Object creation.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Aug 2007 12:30:57 +0000 (12:30 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Aug 2007 12:30:57 +0000 (12:30 +0000)
Profiles can't be named like other FAI object

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7115 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 02fab1345de33a42c7d646468dc58acb8d724c3f..d6bf8cca3319d9994279cf33770d440a13919180 100644 (file)
@@ -62,7 +62,7 @@ class askClassName extends plugin
       foreach($res2 as $object){
 
         /* skip class names with this name */ 
       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'])){
           if(isset($object['FAIstate'][0]) && preg_match("/removed$/",$object['FAIstate'][0])){
             continue;
           }
           if(isset($object['FAIstate'][0]) && preg_match("/removed$/",$object['FAIstate'][0])){
             continue;
           }
index f7ec6810c13d5504306cd059b7a515dd3c2d5828..e20bb04ef136f9cdd2c6c53b9da7d9311572867f 100644 (file)
@@ -412,8 +412,8 @@ class faiProfile extends plugin
       $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
     }
 
       $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);
     }
 
     return ($message);