Code

Updated department type detection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Oct 2008 08:06:10 +0000 (08:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Oct 2008 08:06:10 +0000 (08:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12818 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_MultiSelectWindow.inc

index ebdd1a391ff2db4ec892b7dc7505c4d18c110df2..54df235d08f97e2d96f8af94fb707c1af8d8a796 100644 (file)
@@ -672,7 +672,7 @@ class MultiSelectWindow{
 
                /* Get all departments within this subtree */
     $s_filter = "";
-    $s_attrs  = array("description");
+    $s_attrs  = array("description","objectClass");
     $s_acls   = array();
     foreach($types as $name => $data){
       $s_filter.= "(&(objectClass=gosaDepartment)(objectClass=".$data['OC'].")(".$data['ATTR']."=".$this->base_selection_regex."))";
@@ -683,7 +683,7 @@ class MultiSelectWindow{
     $tmp = get_list("(|".$s_filter.")",$s_acls,$this->selectedBase,$s_attrs,GL_NONE);
     foreach($tmp as $attrs){
       foreach($types as $name => $data){
-        if(isset($attrs[$data['ATTR']][0])){
+        if(in_array($data['OC'],$attrs['objectClass']) && isset($attrs[$data['ATTR']][0])){
           $attrs['NAME'] = $attrs[$data['ATTR']][0];
           $attrs['TYPE'] = $data;
           $name = $attrs['NAME']." ".$attrs['dn'];