Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76794

Admin ID hardcoded in sync_roles function

    XMLWordPrintable

Details

    • MOODLE_401_STABLE
    • Easy

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            deividaspranevičius Deividas Pranevičius
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 minutes
                2m