This reverts commit fb9c6a39. Instead of the code change, Openfire should be configured with unique identifiers in its system property 'ldap.usernameField'.