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

LDAP Enrolments with nested groups fails when group names have ldap filter characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.6.3, 2.7
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE

      Description

      With nested groups enabled, If a user is a member of a group which has brackets in the name then the enrolment plugin will fail to return the user's enrolments

      in function find_ext_enrolments of enrol/ldap/lib.php:

      if($this->get_config('nested_groups')) {
          $usergroups = $this->ldap_find_user_groups($extmemberuid);
          if(count($usergroups) > 0) {
              foreach ($usergroups as $group) {
                  $ldap_search_pattern .= '('.$this->get_config('memberattribute_role'.$role->id).'='.$group.')';
              }
          }
      }
      

      I did find using ldap_filter_addslashes around $group will fix the problem

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                supton.overtsoftware Steve Upton
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: