mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
MDL-59377 course: when module intro is visible display embedded files
Even when course module is not available the intro text can still be visible on the course page. In this case the availability restriction is displayed to the student but link to the activity is not available
This commit is contained in:
parent
16a68a2f76
commit
66347456ec
@ -4650,7 +4650,18 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
|
||||
if (!plugin_supports('mod', $modname, FEATURE_MOD_INTRO, true)) {
|
||||
send_file_not_found();
|
||||
}
|
||||
require_course_login($course, true, $cm);
|
||||
|
||||
// Require login to the course first (without login to the module).
|
||||
require_course_login($course, true);
|
||||
|
||||
// Now check if module is available OR it is restricted but the intro is shown on the course page.
|
||||
$cminfo = cm_info::create($cm);
|
||||
if (!$cminfo->uservisible) {
|
||||
if (!$cm->showdescription || !$cminfo->is_visible_on_course_page()) {
|
||||
// Module intro is not visible on the course page and module is not available, show access error.
|
||||
require_course_login($course, true, $cminfo);
|
||||
}
|
||||
}
|
||||
|
||||
// all users may access it
|
||||
$filename = array_pop($args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user