Auto Assign Specific Role After "Sign Up" auto-enrollment.

Auto Assign Specific Role After "Sign Up" auto-enrollment.

by Troy May -
Number of replies: 2

I have a course which everyone who registers is automatically enrolled in via the Sign Up enrollment method plugin.

I want all new users who register to be auto-enrolled in this course AND be given the custom role designation of "NEW REGISTERED USER".

I have created this custom role in my Define Roles area.

Unfortunately, for some reason every time a new user registers, they are given just the role of Student.

I have set the default role assignment to this new custom role in the course's Sign Up enrollment method settings.

I have also set the default role assignment to this new custom role via the Plugins > Enrollments > Sign Up settings.

But still no matter what, when a new user registers, they are auto-enrolled in the course, but the system slaps on a basic Student role, and disregards the default settings I adjusted for it.


Does anyone know why this is happening? Any help would be appreciated.

Average of ratings: -
In reply to Troy May

Re: Auto Assign Specific Role After "Sign Up" auto-enrollment.

by Troy May -

I figured out why.


In the plugin's lib.php file, there is actually a "default" designation for roleid=5, which is Moodle's good ole "student" role id.


I changed the 5 to 15, which is the roleid my custom role exists as, and guess what?


IT WORKED.


The author, or whomever handles Sign Up should rework their plugin so it registers a change in default role to assign to registered users ON THE CONFIGURATION PAGE, not in the plugin's base code.


Hope I could help someone.

In reply to Troy May

Re: Auto Assign Specific Role After "Sign Up" auto-enrollment.

by ankit katmore -

Hello there,

Can you let me know the filename,location where i can change the role id.

Thanks