From: hickert Date: Fri, 8 Oct 2010 12:52:44 +0000 (+0000) Subject: Updated folder handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7a252b82ec2be0f6d5c73cb54d9983ac8c5adad;p=gosa.git Updated folder handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19957 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc index d40dcd49a..ae3c5f9e6 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_FolderWidget.inc @@ -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) diff --git a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc index 6d5166908..884397bdf 100644 --- a/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc +++ b/gosa-plugins/groupware/personal/groupware/FolderWidget/class_filterFolderWidget.inc @@ -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);