From: psc Date: Fri, 20 Nov 2009 10:29:22 +0000 (+0000) Subject: Allow duplicated class names of different types X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f71854fe6d1c9b9d46afaa27187aa809f1139151;p=gosa.git Allow duplicated class names of different types - When adding a new class with a name that already exists, but has a different type (e.g. is stored in another RDN), do not show a warning. (Trac: #3200) - Don't search for objects with FAIstate removed git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14829 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc b/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc index de302bd2a..3d3beb2eb 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_askClassName.inc @@ -151,9 +151,19 @@ class askClassName extends plugin } else { /* Check if the given ClassName is already used in another administrative unit */ + switch($this->objectClass) { + case "FAIpartitionTable": $rdn = get_ou('faiPartitionRDN'); break; + case "FAIpackageList" : $rdn = get_ou('faiPackageRDN'); break; + case "FAIscript" : $rdn = get_ou('faiScriptRDN'); break; + case "FAIvariable" : $rdn = get_ou('faiVariableRDN'); break; + case "FAIhook" : $rdn = get_ou('faiHookRDN'); break; + case "FAIprofile" : $rdn = get_ou('faiProfileRDN'); break; + case "FAItemplate" : $rdn = get_ou('faiTemplateRDN'); break; + } $ldap= $this->config->get_ldap_link(); - $filter = "(cn=".$this->ClassName.")"; - $ldap->cd($this->parent->fai_release); + $filter = "(&(cn=".$this->ClassName.")(!(FAIstate=|removed)))"; + $base = $rdn . $this->parent->fai_release; + $ldap->cd($base); $ldap->search($filter, array("dn","gosaUnitTag")); if ($ldap->count() > 0) {