Your Moodle version

Authentication: Autoenrol cohort

auth_mcae
Maintained by Picture of Andrew Kama Andrew Kama
This Authentication plugin automatically enrol users into cohorts. Cohort name depends on user profile field.
Moodle 2.2, 2.3

This Authentication plugin automatically enrol users into cohorts.

Cohort name depends on user profile field.

How to use:

  1. Copy plugin into /moodle/auth directory
  2. Go to Site administration - Notifications page and install it
  3. Go to Plugins - Authentication and enable plugin
  4. Configure main rules (template for cohort name)
    second rule (replace empty field)
    and replacement array
  5. Enable unenrol option

Cohorts are created in CONTEXT_SYSTEM

See README.md for details

EXAMPLE:

You have a custom profile fields "status" (student, teacher or admin) and "course". 

You wnat to enrol many users into cohorts like "course - status" than enrol cohorts into courses.

At configuration page set:

Main template to %profile_field_course - %profile_field_status

Empty field text (When field is empty this value used) to none

Result:

When 1st course student logins, he enrol to cohort named "1 - student"

When 1st course teacher logins, he enrol to cohort named "1 - teacher"

When admin logins, he enrol to cohort named "none - admin" (Course not set, status - admin)

To rename "none - admin" cohort to "Administration" you must set a replacement array field at the configuration page (1 replacement per line, old_value|new_value)

In our case: none - admin|Administrator

Result:

When admin logins, he enrol to cohort named "Administrator"

Screenshots

Screenshot
Screenshot
Screenshot

Contributors

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

Comments RSS

Show comments
  • Picture of John Anderson
    Wed, Jun 19, 2013, 9:11 AM
    Can I use this to auto enrol a user to a cohort based on email domain? Or does it have to be a profile field ?
  • Picture of John Anderson
    Thu, Jun 20, 2013, 8:55 AM
    I cannot understand the instructions. Could someone who has had success with this plugin provide their examples? I would like to help with the documentation, after I have a working example.
  • Picture of Kevin TREUSSIER
    Wed, Jul 3, 2013, 4:02 PM
    Very great Plugin !

    It's exactly what I need to create cohort corresponding to groups that exist in a shibboleth attributes that I receipt.

    I just need 1 improvement if it's possible :
    The field I request contain multi-values, separate by a ";" (in exemple "gs2;GIPAD-GS2", or "gs2;AII-GS2")
    Is it possible to split this cohort in 2 or more cohorts, defining by a separator parameter (in my case ";" to obtain 3 cohorts ("gs2", "GIPAD-GS2" and "AII-GS2") rather than 2 ("gs2;GIPAD-GS2" and "gs2;AII-GS2")) ?

    Thanks a lot for this plugin.

    Kevin
  • Picture of Kevin TREUSSIER
    Mon, Aug 12, 2013, 6:59 PM
    Hello,

    Thanks a lot Andrew for this new release with the improvement I need.
    It is exactly what I want and it works great !

    Kevin
  • Picture of chispol rios
    Tue, Aug 20, 2013, 7:48 AM
    Hi, is there more documentation related this plugin?
  • Picture of Andrew C
    Thu, Aug 22, 2013, 4:37 AM
    Fantastic plugin.
  • Picture of Jared Annis
    Thu, Sep 19, 2013, 7:23 AM
    Great job on this plugin! It works great as long as I log into moodle directly. I'm using Drupal-Moodle SSO for most of my end users, however. Is there a way have Moodle authentiate through Drupal Service, and then still auto enrol the user into a cohort?
  • Picture of Julia Küfner
    Thu, Sep 19, 2013, 8:21 PM
    Does anyone use this plugin with mnet ? It works great for all other authentication methods but with mnet it doesn't seem to be called when the user logs in ?
  • Picture of Seyit Kaya
    Sat, Sep 28, 2013, 12:23 AM
    How can i use it please explain
  • Picture of Seyit Kaya
    Sat, Sep 28, 2013, 12:28 AM
    How can i use it please explain i cant do it
  • Picture of Carlos Rubalcava
    Thu, Oct 17, 2013, 6:02 AM
    At what point does this gets done? At login or at signup or at course access?
  • François Lizotte
    Fri, Mar 7, 2014, 3:57 AM
    Hi, I think this module could really be useful, but I can't figure out the syntax. All I want to do is to enrol students in a cohort according to a profile field. Let's say field Program = Science. Then, all users having science would be enroled in the Science cohort.
  • Picture of Jefferson Bien-Aime
    Sat, Jun 7, 2014, 12:57 AM
    Great Plugin! in the availables templates, I didn't find description, but description, but I want to create cohort based on description-Departement. is It possible?
  • Picture of Jefferson Bien-Aime
    Sat, Jun 7, 2014, 2:44 AM
    Can we have a "%description"? I didn't find description, but description, but I want to create cohort based on %description-%departement. is It possible?
  • Picture of Davi DePaula
    Thu, Jun 12, 2014, 10:32 PM
    Has anyone tried this plugin with Moodle 2.7? Thanks.
1 2 3
Please login to post comments