Merge branch 'MDL-64228-master' of git://github.com/jleyva/moodle
authorJun Pataleta <jun@moodle.com>
Thu, 29 Nov 2018 12:51:52 +0000 (20:51 +0800)
committerJun Pataleta <jun@moodle.com>
Thu, 29 Nov 2018 12:51:52 +0000 (20:51 +0800)
1  2 
repository/nextcloud/lib.php

@@@ -428,7 -428,11 +428,11 @@@ class repository_nextcloud extends repo
          }
  
          if (!$this->client->is_logged_in()) {
 -            $this->print_login_popup(['style' => 'margin-top: 250px']);
+             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'], $options['embed']);
              return;
          }