-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1
-
MOODLE_401_STABLE
-
Easy
I encounted an issue where on some moodle instances LDAP group mapping simply won't work. After digging into moodle source code, I found out that list of roles are retrieved with function get_ldap_assignable_role_name and has admin user id hardcoded into arguments. In my case, admin user was created with ID other than the one hardcoded (4, instead of 2).
https://github.com/moodle/moodle/blob/MOODLE_401_STABLE/auth/ldap/auth.php#L1799
When I replaced the ID with the actual one, everything started to work.
This clearly needs to be improved. ID can be replaced with admin user username. Personally, I don't see a need for so much complexity and just list all the roles, instead of picking the roles that specific admin user can assign.