User profile doesn't respect disableuserimages setting

The Edit Profile tab of the user profile page does not respect Moodle's disableuserimages setting. This setting should prevent users from editing their own image (and does on the standard theme).

As a workaround, CSS can help a bit:

/* prevent users from changing their own profile picture */
#page-user-profile section.editprofile #fitem_id_moodle_picture, #page-user-profile section.editprofile #fitem_id_currentpicture, #page-user-profile section.editprofile #fitem_id_currentpicture + div.form-group, #page-user-profile section.editprofile #fitem_id_imagefile, #page-user-profile section.editprofile #fitem_id_imagealt {
    display: none;
}

To fix, a settings check would be needed here: https://gitlab.com/jezhops/moodle-theme_adaptable/-/blob/master/classes/output/core_user/myprofile/editprofile_form.php#L210

And for extra safety, here too: https://gitlab.com/jezhops/moodle-theme_adaptable/-/blob/master/classes/output/core_user/myprofile/editprofile.php#L227

Assignee Loading
Time tracking Loading