-
Bug
-
Resolution: Fixed
-
Minor
-
1.7.2
-
None
-
MOODLE_17_STABLE
-
MOODLE_18_STABLE
Moodle new users created by nightly sync with LDAP directory are not assigned the creator role if they are members of the LDAP group mapped to "course creators".
My guess is lines 608-610 of auth/ldap/lib.php, in function auth_sync_ldap that currently are :
if(!empty($add_users)){
print "User entries to add: ". count($add_users). "\n";
if ($creatorroles = get_roles_with_capability('moodle/legacy:coursecreator', CAP_ALLOW))
{ $creatorrole = array_shift($roles); // We can only use one, let's use the first one <--- HERE }should be (like they are in lines 560-562 of the update users section) :
if(!empty($add_users)){
print "User entries to add: ". count($add_users). "\n";
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 }the $roles variable do not exist in the script , so the test if (isset($creatorrole->id) just fails in line 611 later ...
Cheers.