We have an issue with our installation of moodle where some LDAP users were only half unenrolled.
We currently have the "disable enrolment and remove role" option chosen for external unenrol actions, mainly to account for possible issues if the LDAP server is to go down or get corrupted.
In the attached screenshot you can see John Doe is properly unenroled, however Jane Doe is not. Dudley Do-Right is an example of a currently enroled user. When John Doe signs in, they do not see the course (as expected. Jane Doe still sees the course when signing in, and is able to access it as a guest user.
This is becoming problematic so I'm looking into a way to find all the users this may be affecting so that I can change whatever flag is in place for enabled/disabled enrolment. However I cannot seem to locate the flag/value that gets changed. Is there anything in the moodle DB that has this information? Or does it check with the LDAP server every time the user connects?
If it is the latter, is there a way that we can trigger moodle to basically refresh it's knowledge of enrolments? Not changing anything unless it's not valid?