Skip to main content
If you continue browsing this website, you agree to our policies:
x
Moodle.org

Moodle 2.5 LDAP enrolment error

Moodle 2.5 LDAP enrolment error

by Oliver Nellen -
Number of replies: 5

I found the following post in another forum:

Moodle 2.1 LDAP enrolment error
Please save me from tearing my hair out! We have a Moodle set up, which was running version 2.0.3 on Win2008r2SP1 with IIS and SQL. We have been using LDAP authentication and enrollment fine (using samaccountname as the userID). Part of the summer work was to upgrade to version 2.1.1 and implement HTTPS, which both went fine.
Now it seems that LDAP Enrolment has been broken. Authentication still works, and enrolment works if I run the CLI PHP sync script. But it does not run on log in! Or perhaps rather it does run, but incorrectly, as I have it set to unenrol users from a course if they are removed from the AD groups. What happens in that case is that when a user logs in they are unenrolled from all their courses if they were enrolled in them via LDAP. (perhaps it sees the groups but believes they are not in it?)
I've rolled back the version of Moodle and undone all the changes made, but its still broken, nothing has changed with AD etc and I've triple checked all the settings in Moodle. Thoughts or ideas would be appreciated!

 

We face the same problem after we updated from 2.3 to 2.5. Does anbody have an idea how to resolve this error?

 

 

 
 
 
Average of ratings: -
In reply to Oliver Nellen

Re: Moodle 2.5 LDAP enrolment error

by Seb Harrington -

Same issue here, I have set ldap enrolment to 'keep users enrolled' and set up a cron job (scheduled task) to run the ldap enrolment at 4am in the morning from the cli - when I hope no one will be using moodle.

I have altered the ldap sync script slightly so that unenrollment actually works:

 

if (!enrol_is_enabled('ldap')) {
cli_error(get_string('pluginnotenabled', 'enrol_ldap'), 2);
}
/** @var enrol_ldap_plugin $enrol */
$enrol = enrol_get_plugin('ldap');
$enrol->set_config('unenrolaction', ENROL_EXT_REMOVED_UNENROL);
$trace = new text_progress_trace();
// Update enrolments -- these handlers should autocreate courses if required.
$enrol->sync_enrolments($trace);
$enrol->set_config('unenrolaction', ENROL_EXT_REMOVED_KEEP);

 

unfortunately if anyone does log in whilst the script is running they will lose their courses. I suppose I could modify the above to put the site into maintenance mode but I' hoping the LDAP enrolment issue will be fixed very shortly.

In reply to Oliver Nellen

Re: Moodle 2.5 LDAP enrolment error

by Seb Harrington -

I have launched a bug on the tracker. Could you read it, add any other comments and vote for it so the devs know it's not just me experiencing the issue. If you could also post the link to the bug in reply to the original forum post you found and ask them to chime in and vote that would be great.

link: https://tracker.moodle.org/browse/MDL-43430

Thanks,

Seb

In reply to Oliver Nellen

Re: Moodle 2.5 LDAP enrolment error

by Seb Harrington -

Oliver,

Can you tell me if the users who are being unenroled in your situation are a member of lots of groups (50+)?

Is it happening to a specific group of people or everyone?