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:
1345 sites
110 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


  • Tue, May 23, 2017, 2:10 PM
    Hi Bobby,

    So your enrolment instance seems to be set up correctly. If you don't click the button, users will be enrolled when they log in.
  • Tue, May 30, 2017, 2:12 AM
    Hi Nicolas,

    I'm trying to use the pluggin to enrol users by a city of a region, in the User profile fields rules I set firstly the "Region" field, then I added a field "autoenrol" in order to be able to unenrol users and finally I added group of fields where I put several cities. It looks like this:

    Enrol if: (region=metropolitana)AND(autoenrol=1)AND((city=santiago)OR(city=La Pintana)OR(city=melipilla))

    Everything works good, but when I use city named with two word like "La Pintana" the pluggin does't work.

    Can you help me?
  • Wed, May 31, 2017, 3:57 PM
    Hi Ricardo,

    A very good usage of this plugin indeed ! It should work but it appears that the space is causing some problem.

    When you display the rule editor when editing an existing rule, the plugin should display debugging information at the bottom of the page. Could you send me those? (preferably via private message)
  • Wed, Jun 14, 2017, 4:54 PM
    First of all, plug in is GREAT!
    Can I use two conditions? I have two custom fields, one is starting day of work and I want enroll users started working BEFORE some day.
    Second, i have another custom field, employed, or not.
    Can you help?
  • Thu, Jun 15, 2017, 10:41 PM
    Hi there, I'm having a hard time getting this working... When I go to my settings for the plugin I can't change any of the settings even though it's showing my "profile fields to be used in the selector". I have "User Type" and should be able to choose between employee or client.
    It says "If you don't select any role here, this makes the plugin moot and hence disables its use in courses.
    The feature below may however still be used in this case."
    Any idea what I'm doing wrong??? The option isn't offered in the courses either.
    My screen certainly doesn't look like your screen cap in the description either. sad
  • Fri, Jun 16, 2017, 2:29 PM
    Hi Borko,

    Thanks for your feedback. You can use two (or any number of) conditions by cliking the "+" sign to add a condition. However, this plugin currently only checks for equality (i.e. if some attribute is equal to a value). You would need to check for a value smaller than another (i.e comparing dates), which is not possible at the moment.

    This could probably be programmed quite easily but I really don't have any time to do this in the foreseeable future. If you could come up with a code change providing this feature, I'd be happy to integrate it.
  • Fri, Jun 16, 2017, 2:33 PM
    Hi Kate,

    In the main plugin settings, you have to set the "Default role" and at least one item in Profile fields to be used in the selector". Is that the case ?

    Then, under your Moodle administration, under "Manage enrol plugins", make sure this plugin is enabled.

    After that, you should have the option to add this enrolment method to any of your courses.
  • Fri, Jun 16, 2017, 8:44 PM
    Hi Nicolas,
    The default role only shows one profile field - and it's the one that I created "Profile Fields" - it doesn't allow me to choose any other profile field, nor does it allow me to choose anything further. I do have the plugin enabled as well. If I could attach as screen cap it might explain better what I'm seeing, but I don't have that option here. sad
  • Fri, Jun 16, 2017, 9:00 PM
    Hi Kate,
    This is a limitation of this plugin, it only works using custom profile fields (i.e. the one(s) you created yourself). So no standard fields can be used.
  • Fri, Jun 16, 2017, 9:12 PM
    Okay, that's not a problem... that's the profile field I want to use anyway, but I still can't get it to show up at the course level. I still only get "self / manual" enrolment. I have the plugin installed in a Moodle 3.1.2+ site. I'm using "Academi" as my theme. Could that be an issue?
  • Fri, Jun 16, 2017, 9:27 PM
    Theme should not be an issue – it could make things display incorrectly, but not disappear completely. So, the other possible issue is that you need to have the 'enrol/attributes:config' permission in that course, and that is normally only for managers (i.e. not for teachers). What role do you have in that course?
  • Fri, Jun 16, 2017, 9:30 PM
    I'm the administrator for the site. smile
  • Fri, Jun 16, 2017, 9:55 PM
    Kate, yes that's what I thought. I can't come up with any more ideas but PM me if you want me to further investigate this.
  • Fri, Jun 30, 2017, 4:53 PM
    Hi Nicolas, first of all thank you for this useful plugin. Just a suggestion: it would be great to have the chance to choose between "the field is euqal to" and "the fild contains". Don't know if it's feasible but it could be helpful.
    Thank you again for your contribution.
  • Fri, Jun 30, 2017, 5:12 PM
    Hi Dario,

    Thanks for your feedback and suggestion. Indeed it would be very useful – and so would be other operators (greater than, etc.) – but I have really not time at all to do that in the foreseeable future.

    If somebody was willing to program it I'd be very happy to integrate it so that everybody could use.
Please login to post comments