mirror of
https://github.com/moodle/moodle.git
synced 2025-03-17 22:20:00 +01:00
We need to specify a valid user id in the call to role_assign(). And we only have to make the call if the user has been added successfully, not otherwise. Also make sure we lowercase the memberuser and group distinguished names before comparing them. Depending on the LDAP server we can get mixed case values for the DNs, and the user may have specified the creators group/ou name in a different case. By the way, this has been broken for ages (since the auth cleanup in 1.8, in 2007!). It's a bit strange nobody noticed before :-O Credit goes to Joe Chryst.