When a user logs in using an LDAP account the necessary information is imported into the MantisBT database.

The reason get_user has extra code around this is because some users never log into MantisBT, they just send issues by email and receive status responses by email. So it was necessary to create an extra LDAP hook for backwards compatibility. These days EmailReporting will create all user accounts and adds the email address as well.

There also the MantisBT issue that when a user modifies there account there cached LDAP info is lost and will need to be retrieved again the next time they login. Don't whether this has been fixed yet but i don't think so.

But i've got an idea how to make this code a little better and usable for you. Give me a moment and i'll patch this