learnweb / moodle-repository_owncloud

[ARCHIVE] Starting Moodle 3.6, our plugin ships with Moodle! :tada: Use this:
https://docs.moodle.org/en/Nextcloud_repository
GNU General Public License v3.0
8 stars 8 forks source link

Output access controlled links via Moodle instead of performing a redirect #40

Closed Dagefoerde closed 5 years ago

Dagefoerde commented 6 years ago

This is mandated by Nextcloud, because Nextcloud increasingly uses samesite cookies. Therefore, if we redirect requests for files to Nextcloud in the browser, the browser is not authenticated in Nextcloud. As a consequence, redirects did not work. This is a workaround that first loads the file into Moodle into a per-request directory.

We use send_temp_file, thus ensuring that a) the file is deleted immediately afterwards, and b) configured accelerator mechanisms are used.

codecov-io commented 6 years ago

Codecov Report

Merging #40 into master will decrease coverage by 0.48%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #40      +/-   ##
===========================================
- Coverage     57.79%   57.3%   -0.49%     
- Complexity      170     171       +1     
===========================================
  Files             9       9              
  Lines           706     712       +6     
===========================================
  Hits            408     408              
- Misses          298     304       +6
Impacted Files Coverage Δ Complexity Δ
lib.php 55.89% <0%> (-0.96%) 94 <0> (+1)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d2fec4d...5b5fdbb. Read the comment docs.