Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed function used for getting fullname of students #18

Open
wants to merge 1 commit into
base: MOODLE_3X
Choose a base branch
from

Conversation

AttackVectorDelta
Copy link

Hi,

While testing this plugin on a clean install of Moodle, I noticed an issue. To replicate it, use the following steps:

  • Create a new course
    • add one user with the role of Teacher
    • add one or more users with the role of Student
  • Log in as the Teacher
  • Add an activity to the course
  • Turn on Editing mode and under Edit click the Notifications button on the added activity
  • What should happen, is that the table under Individual participants, which should contain names of students, is actually empty

This happens because the user_get_user_details function, used in classes/notifstudents.php does some permission checking, which fails and the function returns NULL for each user instead of user details. The issue is not present when logged in as Admin.

I fixed the issue by changing the function to the fullname core Moodle function. If the user_get_user_details function needs to be used, the current course object can be passed to the function as the second argument - this changes the way the context is checked and also solves the issue.

Best regards,
Nejc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant