Enrolment tables, extra field, cron

Enrolment tables, extra field, cron

by Martín Langhoff -
Number of replies: 1
To have support for mixed LDAP and 'internal' enrolments and still be able to keep the records straight, I've added an 'enrol' table to user_students and user_teachers.

This field follows suit with the 'auth' field on the 'user' table. enrol_student() and add_teacher() now take an extra parameter (which defaults to 'manual') for the enrolment.

Ideally, the process of loading valid enrolments and pruning invalid/old enrolments that the plugins perform should not prune enrolments of a different type.

This way, you can support users with a hybrid 'external+internal' enrolment usage, just like with authentication.

Of course, this is very experimental code, and discussion is welcome. Patches are even more welcome ;)

On a related note, I've created a separate script that can be called from cron. This is lazy, and certainly not ideal (we could do it from moodle's cron) but allows some extra flexibility, such as running it re-niced.

For a moodle-cron-based sync, it'd be better to do it at the base class level, and add a function call to the interface.
Average of ratings: -
In reply to Martín Langhoff

Re: Enrolment tables, extra field, cron

by mila jovovich -

Hi Martin,

I am trying to have cron call a script, which in turns check some discussion related statistics in moddle database then make decision on sending email to the instructor. Could you please share the source code to show me how to do this? (the modified cron.php and the scripts that being called by cron (it doesn't matter what the scripts does, even authentication or backup)? if you think it is simple and no need to send source code, would you please explain the process a bit?

Thank you!

Mila