mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-64228 nextcloud: Handle the offline parameter in send_file
This will neew a follow-up issue. This patch is just preventing downloading the HTML popup code when a file is not found. Ideally, we should be able to serve the original file using the system OAuth.
This commit is contained in:
parent
599703e83d
commit
676545bc66
@ -410,7 +410,7 @@ class repository_nextcloud extends repository {
|
||||
* @param int $lifetime (ignored)
|
||||
* @param int $filter (ignored)
|
||||
* @param bool $forcedownload (ignored)
|
||||
* @param array $options (ignored)
|
||||
* @param array $options additional options affecting the file serving
|
||||
* @throws \repository_nextcloud\configuration_exception
|
||||
* @throws \repository_nextcloud\request_exception
|
||||
* @throws coding_exception
|
||||
@ -428,6 +428,10 @@ class repository_nextcloud extends repository {
|
||||
}
|
||||
|
||||
if (!$this->client->is_logged_in()) {
|
||||
if (!empty($options['offline'])) {
|
||||
// Right now, we can't download referenced files for offline if the client is not authenticated.
|
||||
send_file_not_found(); // Use this function because it enforces a 404 error.
|
||||
}
|
||||
$this->print_login_popup(['style' => 'margin-top: 250px']);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user