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:
1337 sites
118 fans
Current versions available: 4

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.


Screenshot #0


Nicolas Dunand (Lead maintainer)
RISET Université de Lausanne: Supporting institution
Please login to view contributors details and/or to contact them

Comments RSS


  • Wed, Dec 21, 2016, 3:01 AM
    Trying to setup this plugin and work with it:

    It's showing as installed, and when I manage plugins I can see it. However when I go to a course instance and go to enrollment methods, it doesn't present itself as an option to select and add to the course. Help? (Moodle 3.1 instance)
  • Wed, Dec 21, 2016, 4:25 PM
    Dear Nathan,

    Please check the plugin's main settings page. You have to select at lease one item for the "Profile fields to be used in the selector" setting or the plugin won't be enabled.
  • Thu, Dec 22, 2016, 5:50 AM

    We get an option to set Enrol by user profile fields: Default Role (Set to student currently). That's the only option we have Site Admin > Plugins > Enrolments > Enrol by user profile fields
  • Thu, Dec 22, 2016, 5:42 PM
    Dear Nicolas,

    I could try the plugin. If I fill the customized profile field manualy the pluging works properly. So the problem is with the mapping during the shibboleth authentication. As I described before, only the first course ID is mapped. I think there is a little bug in the PHP code handling the semicolons. However, unfortunately I am not a skilled PHP programmer. I have tried to find a forum post or anything else which deal with the problem but I could not find any.
    Could you please help me regarding this issue or suggest someone who can?

    Best regards,
    Zoltán Szalay

  • Thu, Jan 19, 2017, 6:15 PM
    Users who are subsequently added in bulk will be forced to "force the user to assign"..
    Can we provide automatic attendance for a certain period of time as a scheduled task?

  • Thu, Jan 26, 2017, 2:54 AM
    Hi Nicolas,

    I am working on Moodle 3.1 with this plugin and I am trying to figure out if it's a cron issue or something else that is causing people not to auto enrol. If I use "force" it works fine. It's just 1 rule that need to be checked.

    You mentioned the plug-in works for auto-enrolment on:
    - enrol as user logs into Moodle (if it matches, obviously)
    - enrol during cron job, every 6 hours

    I have set the plugin with my rule, and forced the cron job, but I don't see the enrollment happening with those who have the profile field checked. I am looking at /admin/tool/task/scheduledtasks.php to see if I can find the "6 hour cron job" so I can check if this is the issue, but can't find it for this plug-in. Is the plug-in running at the same time with a different cron task?

    Thank you Gemma
  • Thu, Jan 26, 2017, 4:44 PM
    Hi Gemma,

    Actually this plugin uses the "legacy" cron system, not the scheduled tasks yet – that's why it's not listed there.

    On the actual rule definition, with debugging turned on in Moodle, you can see the actual query and number of user accounts matched ("coutusers"), which might help you diagnose why your rule is not working.
  • Mon, Feb 20, 2017, 6:54 PM
    hello, i have this plugin and I enabled this method in administration >>>> site administration >>>> plugins >>>> enrollments >>>> manage enroll plugins but i don't see this method in course administration >>>> users >>>> enrollment methods. Please help. My moodle is Moodle 3.1.2+ (Build: 20161020)
  • Mon, Feb 20, 2017, 7:05 PM
    Hello Paweł,

    Ditto my comment above from Dec. 21. You have to have at least one profile field selected in the plugin settings to have the enrolment method available in your courses.
  • Wed, Mar 15, 2017, 8:13 AM

    I can´t use the plugin over moodle 3.2, the buttons to add or delete rules doesn't show correctly.

    I Installed the plugin over Moodle 3.2.1 and 3.2.2 with php 5.6.5 and php 7.0 and I have the same problem.
  • Wed, Mar 15, 2017, 3:19 PM
    Hello Ricardo,

    Thanks for reporting this – which theme are you using?
  • Wed, Mar 15, 2017, 8:52 PM
    Hi Again,

    I was using the default theme that come with the 3.2 version, which is "Boost". After your comment I changed it to the "Clean" theme and the pluging now look's good. Thanks a lot!!!!
  • Thu, Mar 16, 2017, 3:03 PM
    Thanks for checking this Ricardo,
    I'll make sure this is corrected in the next release – probably for when Moodle 3.3 gets released.
  • Tue, Mar 21, 2017, 5:33 PM

    We're having issues with auto enrolments when the criteria is slightly more complex, we're using Moodle 3.0.1 and are trying to auto enrol using 4 custom profile fields. I've set the requirements, but when a user creates an account they are not automatically enrolled. However if i go into the settings and select "force enrolments" the desired users are enrolled. This only seems to happen when all 4 critieria are required, my other courses with 3 or less are all fine. Anyone got any ideas?
  • Wed, Mar 22, 2017, 3:03 PM
    Hi Craig,

    Thanks for reporting this. Is it possible that in some way the 4th profile fiels – is it always the same? – would not be set when the user first creates his account?
Please login to post comments