Code

Removed duplicated addslashes
[gosa.git] / plugins / admin / fai / class_askClassName.inc
index a06c77e6d27da0afc3a1de69d5fe2fe5fa46561d..b9f854f75a252d29009b5b85cb4080344621a959 100644 (file)
@@ -50,18 +50,22 @@ class askClassName extends plugin
       $base = $faifilter['branch'];
     }
     $ldap = $this->config->get_ldap_link();
-    $res= get_list("(objectClass=organizationalUnit)", $this->ui->subtreeACL, $base,
-                   array("cn","description","objectClass"), GL_SIZELIMIT);
-    $used = array();
+    
+    $res= get_list("(&(objectClass=organizationalUnit)(!(objectClass=FAIbranch)))", "fai", $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);
-
+      $res2= get_list("(objectClass=*)", "fai", $objecttypes['dn'],
+                      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];
         }
     
@@ -73,7 +77,7 @@ class askClassName extends plugin
         }
       }
     }
-    
+
     /* Create headline
      * Depending on the object type we want to create, a different headline will be shown
      */ 
@@ -110,7 +114,6 @@ class askClassName extends plugin
       $smarty->assign("grey", "");
     }
     $smarty->assign("ClassNames", $used);
-    $smarty->assign("ClassNameKeys", $used);
     $display.= $smarty->fetch(get_template_path('askClassName.tpl', TRUE));
     return($display);
   }