Authentication: Autoenrol Parents

Maintained by Picture of Virgil Ashruf Virgil Ashruf
Auto assign parents, mentors or managers a role to users based on a custom profile field.
232 sites
13 fans

Many parents, mentors or managers want to have easy access to the learner progress of their peers and relations. And we want to be able to easily give them this access. Based on a piece of information in a custom profile field in the learners profile, their parents, mentors or managers can easily be assigned automatically.

There is a basic configuration screen that let's you select the role to assign, and which information you want to compare against.

This plugin is a work in progress. Currently it is able to automatically assign a role to a user but not unassign this role.


Screenshot #0


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

Comments RSS

Show comments
  • Anthony Borrow
    Tue, 10 Sep 2013, 8:54 AM
    Virgil - Many thanks for sharing this plugin with the Moodle Community. I like to encourage folks to provide the source, tracker, and documentation URLs so that folks can better collaborate with you in maintaining the plugin. The plugin seems to install fine and the code looks pretty straighforward. If you could provide the requested URLs and perhaps a screenshot then I think we can get this approved. Let me know if you have any questions. Peace - Anthony
  • MD shot of me from his iphone4
    Tue, 10 Sep 2013, 2:38 PM
    Thanks for sharing this, it looks good to me. Do consider adding your code source host (eg: github) via 'Edit this Plugin' under Administration block.
  • Anthony Borrow
    Wed, 11 Sep 2013, 1:06 AM
    Virgil - I am going to go ahead and approve this. If you are using keep in mind that the recommended name of the repository would be moodle-auth_enrolmentor. You can also use the Github issue system for tracking issues and Moodle Docs for documentation. If you have no already done so, it can be helpful to browse for some hopefully helpful hints. Please do not hesitate to let me know if there is anything I can do to be supportive of your efforts. Peace - Anthony
  • Picture of Virgil Ashruf
    Wed, 11 Sep 2013, 2:19 PM
    Thank you Anthony and Aparup. I have added the source host and have yet to decide on a location for a discussion. It feels kind of awkward to just open up a topic on the forum, or an issue in CONTRIB, and say "Let's discuss it here"
  • Picture of Juan Francisco Romero
    Sat, 1 Feb 2014, 7:57 AM
    Virgil, please help me, how to make to operate this plugin, because I installed it, but I don´t understand how should function.
  • Picture of Michael Milette
    Tue, 11 Feb 2014, 11:02 PM
    Hi Virgil,

    Thank you for making this plugin available to the Moodle community. I really appreciate all your efforts in developing this plugin.

    I just installed the plugin in Moodle 2.6. Haven't done much with it other than activating it however, when I login with debugging set to developer mode and debugging display turned on, I get the following notice message each time I login:

    Notice: Undefined property: stdClass::$profile_field in /auth/enrolmentor/auth.php on line 199.

    I've reported the issue on GitHub:

    Please let me know if you have any questions and when a fix will be available for me to test.

    Best regards,

    Michael Milette
  • Picture of Heather Edick
    Sat, 15 Feb 2014, 6:35 PM
    Thanks for this plugin. It looks promising, but I'm not sure where to go after installing it and adding the user profile field. What happens next?
  • Picture of Virgil Ashruf
    Tue, 18 Feb 2014, 12:19 AM
    Hello Heather,
    The plug-in works autonomously once you've installed and configured the plugin/profile fields. When a user logs in, the plugin checks whether this user is a manager in someone else's profile. If so, the user is enrolled in that profile.

    The plugin now also checks whether or not the user is no longer a parent of someone, in that case the plugin automatically unenrols the user.
  • Picture of Lael ...
    Thu, 13 Nov 2014, 8:45 AM
    Looks promising.
    Is this compatible with 2.7/2.8? Thanks!
  • Picture of Virgil Ashruf
    Thu, 13 Nov 2014, 4:47 PM
    Hi Lael, yes. This should be compatible with 2.7 and 2.8. As it does not contain any code that is affected by any changes. Please let me know if you find out otherwise.
  • Picture of Mukarram Syed
    Fri, 27 Feb 2015, 12:07 AM
    Hi Virgil,

    I am facing an error with this plugin on 2.7.5. There are some user who are just not able to login to the site. They get invalid user error. If I disable your plugin they are able to, I have no clue why this is happening. Everything is ok for these users in their profiles, the database and even the profile fields are all normal. I am not a developer and I don't know what in your code is causing this.
  • Picture of William Michael
    Thu, 18 Jun 2015, 2:35 PM
    Works perfectly, thanks! Is there any way to all TWO parents to be enrolled?

    William Michael, Director
    Classical Liberal Arts Academy
  • Picture of Virgil Ashruf
    Tue, 23 Jun 2015, 5:56 PM
    Hello William,

    Thank you for your interest! Sadly there is no functionality available yet in the plug-in that allows for two parents to be enrolled automatically. As only one unique identifier for an account is actively looked for. I am putting this on the feature request list on my GitHub!
  • Picture of William Michael
    Wed, 24 Jun 2015, 11:00 AM
    Problem has arisen...please help me understand this.

    We use Google OAuth 2.0 so that our students can login to Moodle with their Google Apps accounts. When I first installed the "AutoEnrol Parents" block, it seems that it worked. However, It now seems that the parents and students have been disconnected throughout our system. Fortunately, we're on summer break, so it's no major crisis.

    Any idea why this would happen and what I should do?

    Thank you,
    William Michael

  • Picture of Virgil Ashruf
    Tue, 13 Oct 2015, 3:25 PM
    Hello William, the only reason I can imagine that users are disconnected would be that the profile field containing the connecting info was somehow altered. The plug-in checks the current enrolled children, and the children in which the parent should be enrolled. Then compares these lists. Only when the parent is enrolled in more children than he/she is supposed to, will the plugin unenrol. For instance when there are no matches.
Please login to post comments