Moodle plugins directory: Enrol by user profile fields | Moodle.org
Enrol by user profile fields
Enrolment ::: enrol_attributes
Maintained by Nicolas Dunand
This plugin allows users to be enrolled according to any value stored in their user profile.
Latest release:
1415 sites
540 downloads
132 fans
Current versions available: 6
This plugin allows users to be enrolled according to any value stored in their user profile. If you use an external authentication scheme (LDAP, Shibboleth), you can store values in hidden user fields of the users' Moodle profile, and then use these values to automatically enrol users if some courses.
Useful links
Contributors
Nicolas Dunand (Lead maintainer)
CSE Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them
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.
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
Thanks, but this has been corrected in recent versions. Which version of the plugin are you using?
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!
It is :
- enrol as user logs into Moodle (if it matches, obviously)
- enrol during cron job, every 6 hours
Thanks for your feedback – yeah it would be great, I really have to look into this as soon as I have a moment.
let me join Jürgen's idea, and hope you will have that moment soon
András
great plugin that saves our trainer some time
It would really be great, if it would work with the standard Moodle profile fields as well
Regards, Dietmar
you mentioned, that the enrolment happens in two ways:
- enrol as user logs into Moodle (if it matches, obviously)
- enrol during cron job, every 6 hours
I have the problem, that my users cannot login anymore, when i define many (more than 20) criterias with the "OR" operator, to enrol in one course. It seems that during the login process some SQL querries run in infinite loop preventing the login going on. Only when the Admin purges the SQL queries users can continue to login.
We use Moodle 2.9.2+ with 4.800 Users.
Any ideas?
As the enrolment triggered by the cron job seems to work without problems, is there a way to exclude the enrol process as user logs into Moodle? Where would I have to make changes?
Best regards, Dietmar
Thanks for reporting this.
Indeed it seems that you are hitting performance limits – these can arise when the number of users is high (not so much in your case) or the complexity of the rules increase.
As a first step, you could prevent the execution of the login hook by modifying the code as follows, in the file enrol/attributes/lib.php . After the function declaration `public static function process_login`, on the next line, simply add a line that contains `return true;` (without the quotes).
I hope this helps, le me know!
Nicolas
I am using shibboleth authentication. I have created a custom user profile field named 'courses' and I map the shibboleth attribute 'niifEduPersonCourse' to it.
I receive the courses IDs separated by semicolons from the authentication server. (e.g.: niifEduPersonCourse: BMEGT20M002;BMEVIMH9O02;BMETE11MX01;)
Unfortunately, only the first course ID is mapped correctly and the others are lost. Therefore, I cannot use correctly the 'enroll by user profile fields module' (only for the first course) .
Anyone else meet this problem as well?
Could you please help me to resolve this problem? How can I enroll the users automatically to the right courses based on the course IDs received by shibboleth?
Thank you in advance for your response and help!
Best regards,
Zoltán
This plugin was actually initially developed with this exact idea in mind (Shibboleth attributes, and semicolon-separated values). So it should work as you expect.
To investigate, you would need to turn on debugging (at least temporarily) on your Moodle site, and then display the enrolment method that you're trying to get to work. Below the form should then be displayed some debugging information, containing actual SQL queries that should return corresponding users. This could help you narrow down the problem.
Please do not post sensitive information in public places, but if you're comfortable with it, you can PM me with this additional information, and I'll try to help you out.
Best regards,
Nicolas