Skip to content

Conversation

@owenherbert-catalyst
Copy link
Contributor

@owenherbert-catalyst owenherbert-catalyst commented Nov 25, 2025

This merge requests introduces a new username column for the attendees table. This new column can be toggled on/off with a new configuration setting. This column will also abide by the Moodle protectusername and userpolicies configuration. The attendees download file will include the new field when enabled.

image image

What's been done?

  • Add new username column to page and download file.
  • Fix Codesniffer errors.
  • New attendeesshowusernames config setting.

Testing instructions:

  1. Install this plugin branch on a Moodle 4.5 site.
  2. Create an admin user and a student.
  3. Confirm new "Show usernames in attendees table" plugin setting exists. Set it to true.
  4. Change the Moodle "protect usernames" security setting to true ({domain}/admin/search.php?query=protectusername).
  5. Add username to "Show user identity" Moodle setting. ({domain}/admin/settings.php?section=userpolicies)
  6. Create a test course.
  7. Add F2F to the test course.
  8. Enroll all users to the test course.
  9. Create a F2F session.
  10. Add all users to the F2F session.
  11. Confirm all users appear in the attendees table and the columns are populated with data. Also check downloaded file.
  12. Change the Moodle "protect usernames" security setting to true ({domain}/admin/search.php?query=protectusername).
  13. Confirm that the username column disappears in the attendees table. (that moodle setting blocks username display). Also check downloaded file.
  14. Undo step 12.
  15. Confirm that the username column reappears in the attendees table. Also check downloaded file.
  16. Run unit tests with vendor/bin/phpunit --testsuite mod_facetoface_testsuite.

Unit testing:

Moodle 4.5.7+ (Build: 20251121), 357864383e7c0b60e3f1d91f1e85712ffb0063aa
Php: 8.3.26, mysqli: 8.0.44, OS: Linux 6.14.0-1015-oem x86_64
PHPUnit 9.6.18 by Sebastian Bergmann and contributors.

................................................................. 65 / 69 ( 94%)
....                                                              69 / 69 (100%)

Time: 00:34.300, Memory: 103.00 MB

OK (69 tests, 2256 assertions)

@owenherbert-catalyst owenherbert-catalyst self-assigned this Nov 25, 2025
@owenherbert-catalyst owenherbert-catalyst changed the title [Draft] Add username column Add username column Nov 25, 2025
@owenherbert-catalyst owenherbert-catalyst marked this pull request as ready for review November 25, 2025 21:26
@danmarsden
Copy link
Member

danmarsden commented Nov 26, 2025

Username is supposed to be protected as private data in normal circumstances. Can we please make sure this respects the protectusernames setting at the bare minimum?

@danmarsden
Copy link
Member

But.. this should also really be a setting, not all sites will want to display username in this report.

@owenherbert-catalyst
Copy link
Contributor Author

Thankyou for the feedback @danmarsden . I'll add a new setting for this feature and make sure it respects protectusernames.

@owenherbert-catalyst owenherbert-catalyst marked this pull request as draft November 26, 2025 03:51
@danmarsden
Copy link
Member

That would only be a bare minimum - probably also worth looking at how the 'show user identity' setting works in user policies settings and if it would be more appropriate for this report to respect those settings. Personally I think it's better to allow an admin to opt in adding this field to the report.

@owenherbert-catalyst owenherbert-catalyst marked this pull request as ready for review November 27, 2025 02:43
@owenherbert-catalyst
Copy link
Contributor Author

Hi @danmarsden , could I please get your feedback for the latest changes to this one?

@danmarsden
Copy link
Member

sorry - unlikely I'll get to this quick - as long as username is not exposed under normal circumstances you should be able find someone in the AU team to do a review.

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.

4 participants