From f71854fe6d1c9b9d46afaa27187aa809f1139151 Mon Sep 17 00:00:00 2001 From: psc Date: Fri, 20 Nov 2009 10:29:22 +0000 Subject: [PATCH] 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 --- .../fai/admin/fai/class_askClassName.inc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) { -- 2.30.2