Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.10, 3.11, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
MDL-70638-311 -
Description
It's possible for a student to embed files (such as a name pronunciation) in the description field of their profile. However, a teacher who tries to view the file will encounter a "file not found" error or similar (with streaming media, it's "The media could not be loaded, either because the server or network failed or because the format is not supported." or something like it, depending on the browser).
I think the root issue is the order of tests in the file_pluginfile function. Within user and profile, assuming login is forced for profiles, they go like this:
- Is the viewing user a guest user?
- Does the target user have a course contact role (i.e. a teacher) and the viewing user have the moodle/user:viewdetails capability?
- Does the viewing user have the moodle/user:viewdetails capability in one or more courses?
The first two tests are an automatic fail, calling send_file_not_found(). I don't think that's right for the second test. If you're a teacher viewing a student you'll never reach the third test, because the student doesn't have the coursecontact role. A teacher can view a teacher's profile, however.
Attachments
Issue Links
- will help resolve
-
MDL-64510 User profile: Embedded images in the description are not displayed as teacher
-
- Closed
-