Instead of fetching LDAP data for a user, first try to fetch Mattermost data. If the data is present, use it; otherwise, fallback to LDAP data.
This applies currently only to the user's name.
This also fixes LDAP cache being previously ignored (the DB changes were not committed).
Important note
This commit breaks a database model. However, the database for cas_bridge
is only used for caching and auth tokens. This means that the database can be harmlessly deleted and re-created from scratch with the right schema, the only consequences being
- the data being fetched again from LDAP and Mattermost the next time (cache cleared) and
- the auth current sessions being invalidated: each OAuth token is invalidated, but Mattermost auth cookies are still valid.