Hello,
I've been wracking my brain with the following issue for several days now with no success so I'm posting a call for help here. Ideas, suggestions, etc. will be most appreciated. (Note - I posted a message in the developer's forum (here: https://moodle.org/mod/forum/discuss.php?d=372241#p1500903) with a request for help with what I thought might be a solution (at least a temporary one) but haven't made much progress there.
So, here goes: I maintain a Moodle site that primarily serves students of a university. Accounts are created automatically via LDAP synchronization. We want to open the email based authentication method for prospective students in order to give them access to a limited set of 'sample' courses. At the same time, we don't want those users to be able to access other courses on the site. This is not a problem for:
a. courses that do not have self-enrollment turned on
b. courses that use self-enrollment in conjunction with a password
However, we do have some courses that allow self-enrollment and do not require the use of a password. Additionally, it is not practical for us to change that setup (i.e. require a password for all self-enrollment courses).
My initial idea was:
1. To have all 'regular' students into a cohort called 'student'
2. To have all email based accounts in a cohort called 'guests'
and then to use the course setting that permits only members of a specific cohort to enroll.
I would like to have this all happen automatically so I thought I would create a trigger in the database (see my developer forum post linked above) that automatically assigned LDAP authenticated users to the 'student' group and 'email' authenticated users to the 'guest' group each time a new record is added to mdl_user. I'm not having much luck and it has been pointed out that this is not the best method. I do understand it is not ideal but, given time restrictions and a limited skill set, it is/what I pursued initially.
I've toyed with the admin tools (profilecohort sync, and cohortrole sync) thinking I could modify one of them...to no avail.
I'm curious if anyone has any creative ideas that I may have overlooked for accomplishing my goal of limiting access to course sets (one set = general student, another set = guests). Also, guest access is not a practical option as there are quizzes etc. in the so-called 'guest' courses that require permissions above that of guest user).
Thanks in advance for any help or ideas that can be provided.
Regards
Jason