Code

Updated base handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Sep 2010 09:15:42 +0000 (09:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Sep 2010 09:15:42 +0000 (09:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19864 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc

index 24373b044a12d4b31ee8b219fd7811487c93801b..d0b7ee41a28336e07308fac4857974f88630d25b 100644 (file)
@@ -316,7 +316,7 @@ class DeviceConfig extends management
         $this->idToName[] = $name;
 
         $base = (isset($current['base']))? ",".$current['base'] : '';
-        $base = "cn={$name}{$base}";
+        $base = "{$type}={$name}{$base}";
 
         $new = array(
                 'base' => $base,
index a27342365b540c909a73e8a3fcee5abccabab31e..f4ac031e60639a23fefe8eeca2c7e1322e37c3c8 100644 (file)
@@ -7,8 +7,11 @@ class filterDeviceItems {
         // Walk through the data array till we reach the correct level, then 
         //  create the list of entries.
         $data = session::get('DEVICE_ITEMS');
-        foreach(array_reverse(preg_split("/[,]*cn=/", $base,0,PREG_SPLIT_NO_EMPTY)) as $name){
-            $data = $data[$name]['children'];            
+        foreach($data as $id => $item){
+            if($item['base'] == $base){
+                $data = $item['children'];
+                break;;
+            }
         }
 
         // Prepare filter, strip out regex regex related chars, except for *