External database auto assignment to role / cohort?

External database auto assignment to role / cohort?

by Jim Walnut -
Number of replies: 4

Hi,


Still very new to Moodle and struggling to find a solution. We have a smallish moodle site 2.7, and the bulk of the users are going to be coming from an External database. This works fine and users in that db can login to Moodle. Problem is I would like to have them auto assigned to a course and also a role with specific permissions. I know when uploading CSV users we can specify things like this but not seeing the same for db users. Is there a simple way to do this so users coming from external db only see the courses and content I want them to - automatically?


Thank you in advance - if I'm lacking any info let me know.

Average of ratings: -
In reply to Jim Walnut

Re: External database auto assignment to role / cohort?

by Jim Walnut -

Hi,


Any help? I'd really like to find a solution so if it doesn't make sense or I'm missing some info required please let me know. Thanks.

In reply to Jim Walnut

Re: External database auto assignment to role / cohort?

by Jim Walnut -

I've seen the following but not able to see the same setting within Moodle (enrol_database | defaultrole from within the plugins setting).

The "enrol_database | defaultrole" setting in the plugin settings page specifies the role that the user will take when they are added to the course. The default setting will set them to the course default setting (initially "student"). However, you can specify a field in the external table (specified in the "enrol_database | remoterolefield" setting) that contains the short name or id for the user's role. This could, for example, be used to enrol both students and teachers into courses using a suitably configured database.

Could anyone tell me where it is? Running Moodle 2.8.

Many thanks!!

In reply to Jim Walnut

Re: External database auto assignment to role / cohort?

by Jim Walnut -

OK I'm slowly getting there I think - https://docs.moodle.org/28/en/External_database_enrolment

If I'm reading right I need to setup another db? Is that correct. One for authentication, one for enrolement? I thought it would just be one db required. Is there no way to do this from within settings (ie just say somewhere that all users authenticated via external db should be X role and in Y courses)?

Appreciate any advice on this.

Average of ratings: Useful (1)
In reply to Jim Walnut

Re: External database auto assignment to role / cohort?

by Jim Walnut -

For completeness I ended up using the same db for external users and enrolment and just added an extra field for the course I want registered - works ok.