aboutsummaryrefslogtreecommitdiff
path: root/lib/filesystem/FileManager.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2021-12-09 09:15:12 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2021-12-09 09:15:12 +0000
commitecc7f65602cb1e94040e094756fddbf5e01a9608 (patch)
treee829dff57f3f960b8d052fc7564256d27bcb553d /lib/filesystem/FileManager.php
parentb55e4ef94131cdfdb8919b01299818db322f9f66 (diff)
fixes #448
Diffstat (limited to 'lib/filesystem/FileManager.php')
-rw-r--r--lib/filesystem/FileManager.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/filesystem/FileManager.php b/lib/filesystem/FileManager.php
index f573be8..6109776 100644
--- a/lib/filesystem/FileManager.php
+++ b/lib/filesystem/FileManager.php
@@ -1736,17 +1736,21 @@ class FileManager
if (is_null($user_id)) {
$user_id = $GLOBALS['user']->id;
}
+
+ $status = $GLOBALS['perm']->get_perm($user_id);
+ $active_upload_type = 'default';
+
$range_object = get_object_by_range_id($range_id);
- $active_upload_type = null;
if ($range_object instanceof Course) {
$status = $GLOBALS['perm']->get_studip_perm($range_id, $user_id);
$active_upload_type = $range_object->status;
} elseif ($range_object instanceof Institute) {
$status = $GLOBALS['perm']->get_studip_perm($range_id, $user_id);
$active_upload_type = 'institute';
- } else {
- $status = $GLOBALS['perm']->get_perm($user_id);
- $active_upload_type = "personalfiles";
+ } elseif ($range_object instanceof User) {
+ $active_upload_type = 'personalfiles';
+ } elseif (Message::exists($range_id)) {
+ $active_upload_type = 'attachments';
}
if (!isset($GLOBALS['UPLOAD_TYPES'][$active_upload_type])) {