Flat File enrollment

Flat File enrollment

by Apostolos Kostas -
Number of replies: 5

Hi there!

Currentrly, I'm using LDAP (Active Directory) authentication and i don't want to use it for enrollment as well. The reason is that i need flexibility on what students to enroll in which course...

Because AD exports in txt format the users with the username and moodle uses as unique id the internal ID of the user in mySQl, it is not possible to use flat file enrollment and LDAP authentication at the same time.

Any ideas of how we can change the flat file enrollment to be based on username and not on user id?

Thank you in advance

Best regards,

Tolis

Average of ratings: -
In reply to Apostolos Kostas

Re: Flat File enrollment

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Flat file enrolment is not based on user id, but on 'ID Number'. And you can map 'ID Number' to anything you want in your LDAP settings page. For example, to the AD userame (sAMAccountName). And pretty much the same for the courses: it uses the course's 'ID Number', not their internal id.

Saludos. Iñaki.

Average of ratings:Useful (1)
In reply to Iñaki Arenaza

Re: Flat File enrollment

by chris dennison -

Hello - I am trying to get some data automatically loaded into some "custome profile fields" and I have used the enrollement upload module as a base from which to work.

The purpose of the is note is to say that I changed the get_record query to use username instead if ID and it works fine.

I changed:  /enrol/flatfile/enrol.php on line 160 (moodle 1.8+)

from:

If !$user = get_record ("user", "idnumber", fields[2]..........

to:

If !$user = get_record ("user", "username", fields[2]..........

Then the third field of the cvs file should be the user logon name as exported from AD.

Average of ratings:Useful (2)