Your Moodle version

Enrolment: Enrol by user profile fields

Maintained by Picture of Nicolas Dunand Nicolas Dunand
This plugin allows users to be enrolled according to any value stored in their user profile.

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


Picture of Nicolas Dunand
Nicolas Dunand (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Nicolas Dunand
    Tue, Nov 17, 2015, 8:45 PM
    Dear all,

    I've just released a new version of this plugin, which addresses all known problems. It is available immediately, and also officially supports Moodle 3.0.

    Thanks to all who reported bugs, and especially to Martin from Canada and Kathrin from Germany, who wen to great lengths to provide details of their debugging sessions.
  • Picture of Jon Bolton
    Wed, Nov 18, 2015, 10:00 PM
    Superb - works really well, thank you. Would it be possible to show the standard user profile fields (eg. city/town, country) as well as custom profile fields?
  • Picture of Nicolas Dunand
    Wed, Nov 18, 2015, 10:22 PM
    Thanks Jon.

    Yes, I would like to add this in the future. I've added this as a feature request (see ).

    In the meantime if anyone is willing to work on this feature I'd be glad to include it.
  • Picture of Sudhanshu Verma
    Thu, Nov 19, 2015, 2:58 PM
    Dear Nicolas,
    Thankyou Nicolas for releasing this plugin once again and fixing issues. You have done really a goodjob by making this plugin.

    Once again thankyou smile

  • Picture of Tyler Whiteley
    Wed, Dec 16, 2015, 10:27 AM
    Hello, where do I set the duration of enrollment? When I look at the student in enrolled users, I do not see an enrollment end date.
  • Picture of Justin Almeida
    Thu, Dec 24, 2015, 2:58 AM
    Tyler, it looks like there's no ability to define duration (with expected UI interactions) with this plugin unfortunately.

    Nicolas, great work here thank you! It's plugins like this that add basic functionality yet drastically improve efficiency that I enjoy using. No duration/expiration feature aside, still an excellent plugin.

    Could this functionality be extended to work with group enrolment keys also?
    Or what about some method to assign a role to a category, such as listing them along with the role in relation to a defined custom profile field?
  • Picture of Nicolas Dunand
    Wed, Jan 6, 2016, 5:07 PM
    Tyler, indeed there is no such functionality yet.
  • Picture of Nicolas Dunand
    Wed, Jan 6, 2016, 5:08 PM
    Justin, thanks for your feedback. Could you elaborate on how you would see the plugin work with group enrolment keys? I'm not sure to understand.
  • On the jetty
    Mon, Jan 25, 2016, 10:21 PM

    Thanks for this plug-in, I am struggling to get it to work however sad

    When I installed and ran an enrolment instance I got a database access error as it was looking for the wrong user name field trying for mdl_user, whereas my db prefix is nmdo.

    So I changed line 102 in the attributes/edit.php (changing 'SELECT DISTINCT FROM mdl_user u ' to 'SELECT DISTINCT FROM nmdo_user u ' )

    The error has gone but the plug-in still will not work, I am trying to enrol based on a drop down profile field value.

    Any ideas or suggestions to investigate much appreciated.


  • Picture of Nicolas Dunand
    Mon, Jan 25, 2016, 10:56 PM
    Hi Roger,

    Sorry about this code, I should remove it in the next release, as indeed the "mdl_" prefix should not be hard-coded.

    As for the drop-down values, I have not investigated a lot about it yet. Could you check in your Moodle database what the actual value for that field would be? Is is the value that's actually displayed in Moodle, or is it some other value somehow?
  • On the jetty
    Mon, Jan 25, 2016, 11:45 PM
    Many thanks for your reply Nicolas, I'm not sure of the physical value stored in the db for the drop down profile field, however I tried using a plain text input field with a simple text value but I'm afraid that did not work either.
  • Picture of Nicolas Dunand
    Sat, Jan 30, 2016, 12:38 AM
    Roger, plain text fields should work in all cases. If you go into the enrollment method you mention, what is the debugging code displayed at the bottom? Maybe PM me instead of posting it here as it may contain some information that could be considered sensitive.
  • On the jetty
    Tue, Feb 9, 2016, 7:33 PM
    thanks will do
  • Picture of michael michael
    Wed, Feb 10, 2016, 8:24 PM
    Dear Nicolas,
    i want to know more about this Enrollment method, we integrate our LDAP with Moodle to import users, also we has about 10 department.
    so now we want to make a self-access course to specific department not to all users.
  • Picture of Nicolas Dunand
    Wed, Feb 10, 2016, 9:50 PM
    Hi Michael,
    If your LDAP integration somehow stores user information in the Moodle database about user's profle (for instance, "department" = "chemistry"), then this plugin could use that information to enroll users automatically (for instance, enroll all users from "chemistry" department in some courses).
1 2 3 4
Please login to post comments