The External Database Enrolment plugin doesn't seem to work the way the documentation says it should: it doesn't autocreate courses when a user logs in.
The documentation refers to what seems to be a deprecated setting (enrol_db_autocreate), and doesn't make it clear that the Synchronization Script is the only way currently supported to create classes from an external database.
I just spent a couple of days banging my head around this problem. Worse, trying to figure it out kept me from spotting a different underlying problem in my external database...
This mismatch / missing feature has existed for at least 3+ years now; it's probably well past time to update the documentation!
The External Database Enrolment Documentation page for Moodle 2.7 still states:
Optionally courses that do not exist in the Moodle site can be created. Switch the "enrol_db_autocreate" option to "yes" in the plugin settings.
And yet, on Friday, 16 December 2011, Petr Skoda wrote in reply to enrol_db_autocreate option missing for course creation :
in 2.x new courses are created when you fill in the external table with course details. The courses are [created] when you execute the enrol/database/cli/sync.php script.
I was planning to add more options for configuration of cron actions and course creation during user login. It should be part of Moodle 2.3 and it might be even backported to some later Moodle 2.2.x
In Moodle 1.9, new courses were created on login if they didn't exist. Unless I'm missing something, this hasn't been added into Moodle 2.X (yet?)....
Thanks!