mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixing ldap ability to modify user fields (#2868)
This commit is contained in:
committed by
Corey Hulen
parent
d4a708ce19
commit
5d7e34c94b
@@ -95,7 +95,7 @@ func (us SqlUserStore) Save(user *model.User) StoreChannel {
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreChannel {
|
||||
func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) StoreChannel {
|
||||
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
@@ -129,14 +129,14 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha
|
||||
user.MfaSecret = oldUser.MfaSecret
|
||||
user.MfaActive = oldUser.MfaActive
|
||||
|
||||
if !allowActiveUpdate {
|
||||
if !trustedUpdateData {
|
||||
user.Roles = oldUser.Roles
|
||||
user.DeleteAt = oldUser.DeleteAt
|
||||
}
|
||||
|
||||
if user.IsOAuthUser() {
|
||||
user.Email = oldUser.Email
|
||||
} else if user.IsLDAPUser() {
|
||||
} else if user.IsLDAPUser() && !trustedUpdateData {
|
||||
if user.Username != oldUser.Username ||
|
||||
user.FirstName != oldUser.FirstName ||
|
||||
user.LastName != oldUser.LastName ||
|
||||
|
||||
Reference in New Issue
Block a user