I am using version 1.7, users records are kept on a LDAP directory. Moodle is set up for LDAP authentication. Enrollment/course data is kept on a Database. Using this database I have created all of the available courses in moodle. Now I have to handle enrollment and my problem is that:
I can't enroll someone unless it exists on moodle's local database, thus I have to ask people to login at least once so that I can add them to a course.
This seems cumbersome, I think I am not doing this the way I should...
I have cehcked de docs on LDAP enrollment but that's not what I want to do, the course/erollment is fine where it is.. or should I bethinking on moving it to LDAP too?? Otherwise the only way I can see is creating everybody a record on Moodle database so that I can register them even before they enter for the first time....
Thanks in advance for your help.
I can't enroll someone unless it exists on moodle's local database
Sure. Otherwise Moodle doesn't know the users you want to enrol.
To overcome this issue, you can use the script called auth_ldap_sync_users.php (located in .../moodle/auth/ldap) which synchronizes all of your LDAP users with Moodle's database. This way, all of your LDAP users are automagically created in Moodle (even if they don't login at all) and you can enrol them wherever you want
"error inserting user XXX with id number _BLANK"
Postgres logsa says moodle is trying to add duplicate (blanks) keys and hence the error.
I located the offending function -insert_record(), which is not returning and ID number why is that?
Apparently Postgres can't keep generating uniques NEXTVALs for id numbers unless an insert is committed to the table. Apparently the problem occurs when you use transactions, so I commented out the begin_sql and commit orders and that fixed the problem.
Is this a bug ???