We're currently using the LDAP authentication plugin to manage our user accounts from Active Directory.
We have a few cases occur where the username of a student has to be changed in AD which results in a new account being made in moodle separate to their original account when they next login with their changed username and their original account's past course data (submitted assignments, forum posts, enrolments....) is not in the new account.
Is there a way to have the profile on moodle defined by a separate variable like an id number which is separate to the username the students login with so that LDAP won't create a new account when the user tries to login with their new username?
I know there is a merge accounts plugin tool but if it wasn't needed and could be avoided that would be great.