diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php
index 6a324f0bc0..9ca4495174 100644
--- a/main/inc/lib/usermanager.lib.php
+++ b/main/inc/lib/usermanager.lib.php
@@ -1,27 +1,5 @@
0) {
- $return = $course;
- $return .= '
';
+ if (!empty($user_id) && !empty($course)) {
+ $user_id = intval($user_id);
+ $path = api_get_path(SYS_COURSE_PATH).$course.'/document/shared_folder/sf_user_'.$user_id.'/';
+ $web_path = api_get_path(WEB_COURSE_PATH).$course.'/document/shared_folder/sf_user_'.$user_id.'/';
+ $file_list= array();
+
+ if (is_dir($path)) {
+ $handle = opendir($path);
+ while ($file = readdir($handle)) {
+ if ($file == '.' || $file == '..' || $file == '.htaccess' || is_dir($path.$file))
+ continue; // skip current/parent directory and .htaccess
+ $file_list[] = $file;
+ }
+ if (count($file_list)>0) {
+ $return = $course;
+ $return .= '';
}
- foreach ($file_list as $file) {
- $return .= '- '.htmlentities($file).'';
- }
- $return .= '
';
}
return $return;
}