Enrol by user profile fields

Maintained by Nicolas Dunand
This plugin allows users to be enrolled according to any value stored in their user profile.
Price option: Free

Supports Moodle 2.1-5.0 See all versions
Latest release: 1 year ago
Installations: 1874
Downloads (last 90 days): 314

Frankenstyle name: enrol_attributes
Enrolment

Comments

Product ratings and reviews are coming to Moodle Marketplace. Until then, existing comments remain available to read, but new posts have been disabled.

I agree with Jürgen that it would be great if other fields could be used, as well. In fact, my wish is just slightly more complicated: I would like to be able to use the email domain or subdomain. For example, all of our students emails end in @student.ourschool.com and our employees end in @ourschool.com. I'd love to be able to auto-enrol students and teachers. We've got a custom "usertype" field (for some reason unknown to me), but I don't know how to populate it automatically, so it's not useful with this plugin, unless we manually enter the data.
Hi Nicolas!
great plugin that saves our trainer some time smile
It would really be great, if it would work with the standard Moodle profile fields as well wink
Regards, Dietmar
Hi Nicolas!
let me join Jürgen's idea, and hope you will have that moment soon smile
András
Hi Jürgen,
Thanks for your feedback – yeah it would be great, I really have to look into this as soon as I have a moment.
Hi Fidel,
It is :
- enrol as user logs into Moodle (if it matches, obviously)
- enrol during cron job, every 6 hours
It would be perfect if this plug-in would work with any profile field, not only custom fields.
Hi,
A *VERY* silly question: does this plugin automatically enrols anyone matching conditions, or is it "enroling as user accesses" - kind of the Self Enrolment builtin plugin? Because I believed it was the second option, and unfortunately all my students share the same extended profile field value ("Student") so all of sudden, in every course that uses your plugin, we have around 3,000 people enroled, to my teacher's dismay lol!
Hi Narissa,
Thanks, but this has been corrected in recent versions. Which version of the plugin are you using?
It appears the plugin doesn't take into account that not all Moodle databases use the old mdl_ prefix. I'm getting an error saying that table 'moodle.mdl_user' doesn't exist which is correct, we have never used the mdl_ prefix. I have edited your source code to get it working so far but it would be good if this could be fixed in the plugin. Cheers
To people using this plugin on a Moodle where the database type is Oracle or MSSQL, be aware that there is a known bug that prevents the enrollments to occur properly.
I'm currently working on this, and will hopefully provide a new release addressing this issue soon.
For more information, see https://github.com/ndunand/moodle-enrol_attributes/issues
Hi Andras,
I've just sent you a private message to sort this out. Once this is sorted I'll post back here if some relevant info came up for other users of this plugin.
just one think to add: when I hit the force enrollment button an ajax window pops up stating this will (re)enroll all users corresponding to this rule. I push OK and nothing happens. When I hit the "purge enrollments" just to test same pop up comes and when I push the ok few sec later an other pop up comes stating, "ok, enrollments are purged". Hope this help to solve the issue.
thanks in advance
Dear Nicolas,
I added and set up the plugin (latest version), and have an issue. As you can see from your debug message your plugin finds two cases when the the enrolment should happen:
sqlquery= SELECT DISTINCT u.id FROM mdl3_user u RIGHT JOIN mdl3_user_info_data d1 ON d1.userid = u.id WHERE (d1.fieldid = 4 AND ( d1.data = 'aaaaa' OR d1.data LIKE '%;aaaaa' OR d1.data LIKE 'aaaaa;%' OR d1.data LIKE '%;aaaaa;%' ))
line 102 of \enrol\attributes\edit.php: call to debugging()
countusers= 2
line 104 of \enrol\attributes\edit.php: call to debugging()
However when I push the force enrollment button nothing happens, even when a user log in no enrolment is happening. When the loged in user wants to enroll manualy Moodle says: you can not enrol yourself ... which is right as your plugin is the only one added to the course.
Please help what is going wrong.
thanks,
András
Thanks Nicolas.
also with regards b) what is the name of the cron job that runs?
Cheers
Peter
Hi Richard,
Official Moodle 3.1 support is available as of now.