moodle-an-hochschulen / moodle-local_bulkenrol

Moodle plugin which provides the possibility to bulk enrol a list of users who are identified by their e-mail adresses into a course.
5 stars 17 forks source link

Case sensitive option #30

Open mirceaman opened 1 year ago

mirceaman commented 1 year ago

Hello,

We've been using the plugin for a while without issues. Recently, we've had a problem with emails being case-sensitive. If a user pastes email addresses in the plugin it now checks for lower case vs upper case which wasn't the behaviour in the past. Anything changed? Is there a way to revert back?

Best regards,

danmarsden commented 1 year ago

@abias - I think there are 2 ways to approach this.

1) delete the custom "local_bulkenrol_get_user()" function and just use the core get_complete_user_data() function instead (which already does the case sensitivity stuff) The main differences are that this function won't return deleted users in the response, and it provides a simpler "user not found" error instead of the 3 different errors you provide in your custom function (user not found, more than one user found, error getting user)

2) We modify the local_bulk_enrol_get_user to do a case insensitive search.

Looking at the code - I lean towards option 1 myself - I'll see if we can send a PR through for you to review using that method.

thanks!

sumaiyamannan commented 1 year ago

Hi @danmarsden I have the PR for it here https://github.com/moodle-an-hochschulen/moodle-local_bulkenrol/pull/31 Regards, Sumaiya