Authentication

 
 
Picture of Matt Gibson relaxing in the Alps
LDAP course creator weirdness
 
Hi,

I'm having some odd problems with this function. It's all set up and working, or at least was until alittle while ago when I stripped down the course creator role to nothing but moodle/course:create. This was to stop creators showing up in the course participants list, which worked, but now when teachers log on, they are being made into site level teachers instead of course creators. I have a feeling this is to do with this code around line 563 of auth/ldap/lib.php

$sitecontext = get_context_instance(CONTEXT_SYSTEM);

if ($creatorroles = get_roles_with_capability('moodle/legacy:coursecreator', CAP_ALLOW)) {

$creatorrole = array_shift($creatorroles); // We can only use one, let's use the first one


so I have changed the legacy course creator role to allow instead of prevent, although I'm not sure this will fix things.

More oddly, when I look at the assign roles dialogue at site level, I have 12 course creators, but checking the list itself only shows 7. I have some defined at course category level, but only 2 or 3.

Can anyone shed any light on what might be going on here?

The problems seem to have started after I ran auth_ldap_sync_users.php from the command line and it ended up removing many teachers and students from their own courses.

Matt
 
Average of ratings: -
Picture of Matt Gibson relaxing in the Alps
Re: LDAP course creator weirdness
 
I've also just noticed (to my horror) that removing those people from their sitewide role as teacher and making them course creators instead removes them from their own courses entirely. I've has to manually add them all again.

What's going on??? sad
 
Average of ratings: -
Picture of Matt Gibson relaxing in the Alps
Re: LDAP course creator weirdness
 
Got it!

The teacher role had course 'Legacy ROLE:Course Creator' set to 'allow'.

Seems that the automatic assignment of course creator role uses the first role with that capability enabled, so if more than one role has it, you'll have problems.

Hope that saves someone some hassle.

Matt
 
Average of ratings: -