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

Course Creator LDAP function broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.6.1
    • 1.4.4
    • Authentication
    • None
    • Solaris
    • Any
    • MOODLE_14_STABLE
    • MOODLE_16_STABLE

      In the function, auth_ldap_isgroupmember, in auth/ldap/lib.php, the search filter is invalid. The following filter is an example:

      (&(uid=username_here)(/(uniqueMember=cn=group_name_here)))

      Obviously, you need to search for the group that contains the user that is authenticating. The following is an example of a correct filter:

      (&(uniqueMember=uid=username_here,ou=some,o=company.com)(/(cn=group_name_here)))

      The following is the output of a diff of a corrected lib.php:

      — lib.php.org Fri Mar 11 11:02:27 2005

      +++ lib.php Fri Mar 11 11:37:23 2005

      @@ -391,25 +391,26 @@

      $ldapconnect = auth_ldap_connect();

      $ldapbind = auth_ldap_bind($ldapconnect);

      + $user_dn = auth_ldap_find_userdn($ldapconnect, $username);

      if (empty($username) OR empty($groupdns))

      { return false; }

      +

      $groups = explode(;,$groupdns);

      //build filter

      • $filter = (& ($CFG->ldap_user_attribute=$username)(/;

      + $filter = (& ($CFG->ldap_memberattribute=$user_dn)(/;

      foreach ($groups as $group){

      $group = trim($group);

      if(!empty($group))

      { - $filter .= ($CFG->ldap_memberattribute=$group); + $filter .= ($group); }

      }

      $filter .= ));

      //search

      $result = auth_ldap_get_userlist($filter);

      return count($result);

      }

            dougiamas Martin Dougiamas
            imported Imported (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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