From 770c365779d4cb455ae81239c153f9ca69719e83 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 10 Jul 2006 04:16:56 +0000 Subject: [PATCH] Fixed detection of already used object names git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4054 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_askClassName.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/admin/fai/class_askClassName.inc b/plugins/admin/fai/class_askClassName.inc index 651957f2d..c45d9996d 100644 --- a/plugins/admin/fai/class_askClassName.inc +++ b/plugins/admin/fai/class_askClassName.inc @@ -51,21 +51,21 @@ class askClassName extends plugin } $ldap = $this->config->get_ldap_link(); - /* Set base to release base */ - $base = key(get_previous_releases_of_this_release(get_release_dn($base),false)); - - $res= get_list("(objectClass=organizationalUnit)", $this->ui->subtreeACL, $base, - array("cn","description","objectClass"), GL_SIZELIMIT); - $used = array(); + $res= get_list("(&(objectClass=organizationalUnit)(!(objectClass=FAIbranch)))", $this->ui->subtreeACL, $base, + array("cn","description","objectClass"), GL_SIZELIMIT ); $delete = array(); + $used = array(); foreach($res as $objecttypes){ $res2= get_list("(objectClass=*)", $this->ui->subtreeACL, $objecttypes['dn'], - array("cn","description","objectClass","FAIclass"), GL_SIZELIMIT | GL_CONVERT | GL_SUBSEARCH); - + array("cn","description","objectClass","FAIclass","FAIstate"), GL_SIZELIMIT | GL_CONVERT ); foreach($res2 as $object){ + /* skip class names with this name */ if(in_array($this->objectClass,$object['objectClass'])){ + if(isset($object['FAIstate'][0]) && preg_match("/removed$/",$object['FAIstate'][0])){ + continue; + } $delete[] = $object['cn'][0]; } -- 2.30.2