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

Admin ID hardcoded in sync_roles function

    XMLWordPrintable

Details

    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

            dineshdurai888@gmail.com Dinesh
            deividaspranevičius Deividas Pranevičius
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.