Code

Updated folder handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Oct 2010 12:52:44 +0000 (12:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Oct 2010 12:52:44 +0000 (12:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19957 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc
gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc

index d40dcd49ac4b2aed04a8a5b700a543fa4bfb2892..ae3c5f9e6cc0ac867fa8e454312c226bb69cebc4 100644 (file)
@@ -24,7 +24,7 @@ class FolderWidget extends plugin
         //  effect on the results.
         $this->rootBase = $this->fakeCnAttr.$this->rootName;
 
-        $this->accountPrefix = rtrim($accountPrefix,'/').'/';
+        $this->accountPrefix = (empty($accountPrefix)) ? "" : rtrim($accountPrefix,$pathSeparator).$pathSeparator;
         $this->rootBase = $this->pathToDn($accountPrefix);
 
         // Update the folder list, initially.
@@ -41,12 +41,12 @@ class FolderWidget extends plugin
 
     function pathToDn($path)
     {
-        $dn ="";
+        $dn ="cn=/";
         $list = preg_split("/".preg_quote($this->pathSeparator,'/')."/", $path,0,PREG_SPLIT_NO_EMPTY);
         foreach($list as $entry){
             $dn ="cn={$entry},{$dn}"; 
         }
-        return(rtrim($dn, ','));
+        return($dn);
     }
 
     function getFolderType($item)
index 6d51669080980355da3de7cc84b7ac1dba012c87..884397bdfd1c5d976f9de8b15da62e5b3db04a39 100644 (file)
@@ -24,7 +24,7 @@ class filterFolderWidget {
 
         // Add entries
         $ret = array();
-        if(isset($data['linear'][$parent])){
+        if(isset($data['linear'][$parent]) && !empty($parent)){
             $item = $data['linear'][$parent];
             $item['name'] = '.';
             filterFolderWidget::addEntry($ret, $item, FALSE, $filter);