LDAP enrolment stuff

LDAP enrolment stuff

by Michael Brown -
Number of replies: 0
I have been trying to set up ldap enrolment (LDAP auth works fine) in our edirectory envierment.  we are using moodle 1.6.2 and am trying to setup LDAP enrolment and I have seen the following issues.

Using CN for the course ID seams to work fine.  Using DN does not (the reason for using DN and not somthing shorter is that any group will be an automatic moodle group plus it is automaticly uniqe).  Looks like it only selects the first letter of the DN which is c ([c]n=groupname,ou=stuff,o=org) so I get output like this when I run the import from the command line:

== Synching c
Creating Course c...OK!

becasue all the courses have the same ID only one course syncs. 

when I do gidNumber nothing gets imported but I do see this in the console

== Synching
Could not find user cn=Person1,ou=Staff,o=GSD, skipping
Could not find user cn=Person2,ou=Staff,o=GSD, skipping

so it looks like it just is nothing picking up the gidNumber field even though it is there and is viewable as the moodle user account in ldap.

When I modify the file moodle/enrol/ldap/enrol.php
---------line 54
$course_ext_id = $enrol[$CFG->enrol_ldap_course_idnumber][0];
to
$course_ext_id = $enrol[$CFG->enrol_ldap_course_idnumber];
----------line 223
$idnumber = $course{$CFG->enrol_ldap_course_idnumber}[0];
to
$idnumber = $course{$CFG->enrol_ldap_course_idnumber};
---------line 589
$course->idnumber  = $course_ext[$CFG->enrol_ldap_course_idnumber][0];
to
$course->idnumber  = $course_ext[$CFG->enrol_ldap_course_idnumber];

it then works properly for the DN but I still have the same trouble with gidNumber

I am guessing the [0] at the end of each line was supposed to refer to the first record of an entry with multiple values but intead it is accessing the value it's self and returning charicter 0 which is c.  Not sure why it would not work for the gidNumber though.  I can probibly use the cn value if needed to I would just like to confirm this issue.  Thanks.





Average of ratings: -