Code

Same here
[gosa.git] / plugins / admin / fai / class_faiProfile.inc
index e9c646ecb38a96a9893d599298b774aa11473fdb..53a511ad704386148e49ad0023971b19d2487f6b 100644 (file)
@@ -391,7 +391,11 @@ class faiProfile extends plugin
 
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($_SESSION['CurrentMainBase']);
-    $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
+    if ($this->old_cn == ""){
+      $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn."))",array("*"));
+    } 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.");