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


  • Sat, Nov 10, 2018, 12:58 AM
    Hi Nicolas, I'm working on Moodle 3.3 and I am using the theme adaptable.
    I installed your plugin but when i go to configurations, it showme nothing.
  • Mon, Nov 19, 2018, 9:16 PM
    Hi, this plugin was working like a charm until a couple of days ago the automatic enrolment by user fields stopped at all! All settings remained untouched, the enrolment logic is working well when testing it with "force enrolment now", cronjob does work properly, no other plugins as well as Moodle updates installed until today when I was updating to the latest release 3.5.3+ (from older build 3.5.3+).

    May I ask if you could provide me with some tips or hints as I actually have no idea what the problem is?!

    Kind regards,
  • Mon, Nov 19, 2018, 9:24 PM
    Hi, which version of the plugin are you using? We've recently added a "Enrol users immediately at login" setting (no change, as it's "On" by default), to improve login speed.

    Things to check:
    1. Does "force enrolments" work as expected?
    2. If using the latest version, if "Enrol users immediately at login" is not checked, then enrolments are only processed when clicking "Force" or by cron, but not at each login anymore.
    3. Try to manually start this plugin's scheduled tasks (in Moodle admin > Server > Scheduled tasks).
  • Fri, Nov 23, 2018, 3:50 PM
    Hi, thank you for your kind answer!

    I'm using the latest build of your plugin (2018092300) with the latest build of Moodle 3.5.3+! "Enrol users immediately at login" is checked. "Force enrolments" is working well, but executing the scheduled task "processenrolments_task" failed because of database write error! So I guess this is causing the issue, right? Is there anything I can do to get this process working again? The other task "invalidatecache_task" is working smoothly.

    Kind regards,
  • Fri, Nov 23, 2018, 4:28 PM
    Hi again, I finally found the issue in the database table "mdl_task_scheduled/processenrolments_task". "faildelay" was set to "86400" and I changed it to "0". Now everything works fine! smile

    No idea why this happened at all.

    Kind regards,
  • Mon, Nov 26, 2018, 3:39 PM
    Hi Georg,

    Thanks for reporting back. Without more information about the exact database error it will be difficult to debug any further. However, as forcing the scheduled task to run again solved the issue it is likely that what caused this was a temporary database condition.

    Glad to hear all is fine, cheers!
  • Fri, Feb 15, 2019, 9:04 PM
    Hi Nicolas, I know this great plugin from earlier versions, but are there any Plans and dates for an update to use this plugin with Moodle 3.6 soon, really need it?
  • Wed, Feb 27, 2019, 7:26 PM
    Hi Nicolas, the latest Version of this plugin for up to Moodle 3.6 does not work. It is activated (eye open) but it does not appear on possible enrol-methodes for any course within the respective dropdown-menue (enrolemethodes)! What may I do wrong here?
  • Wed, Feb 27, 2019, 9:09 PM
    Hi Rolf,
    If the plugin is not configurer correctly at the site level, it won't show in the enrolment methods in a cours.
  • Mon, Mar 18, 2019, 5:25 PM
    Hello Nicolas again. Is it possible to set enrolmentperiod by any means with this plugin?
  • Mon, Mar 18, 2019, 6:53 PM
    Hi Rolf,

    It is not possible at the moment. However, how would this work ? If the user profile field values stay the same, after the end of the enrolment period the user would be enrolled again ?
  • Mon, Mar 18, 2019, 8:31 PM
    Thank you Nicolas
    My idea is, then enrollment with one certain user profile field shout have a time, when it expires.
    those users enroled by a certain field would be enroled for a certain time only. So the enrolment "lasts" for a short time only. When newly enrolled with a special key, Enrolement is valid for 30/45 days only. My thoughts wrong anywhere?
  • Mon, Mar 25, 2019, 10:03 PM
    agree with Rolf. by the way . nice feature.
  • Wed, Apr 3, 2019, 3:33 PM
    Hi Nicolas, and thank you for what seems to be a great plugin.

    Is there a plan to expand on the validation of the user? Because it's is just a little bit simplistic with just an equals.

    For example, my users have the option to register their company name on their profile, and I would like to grant them access to certain courses if they have.
    So in the user profile fields rules I would like to have 'orgno' not null and 'orgno' > 0. Today all I can do is check for 'orgno' = XXXX.
    But in my case all users have different values in that field.
  • Sat, May 25, 2019, 5:46 AM
    Hi Nicolas,
    I have installed this module in Moodle 3.6 and enabled it, but can't find any place where I can configure the enrollment instances. Even inside my courses I can't add this enrollment method. What should I check to have it working?
Please login to post comments