summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-05-02 08:07:58 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-02 08:07:58 -0400
commitc63e027aece1270c8e1378ee27b015304d25f89d (patch)
treeaefef2f1ea027472c62e821c04e6a56b460d931a /store/sql_user_store.go
parent3346a9a63a7c1db582b2f553269c64f4b4a356ef (diff)
downloadchat-c63e027aece1270c8e1378ee27b015304d25f89d.tar.gz
chat-c63e027aece1270c8e1378ee27b015304d25f89d.tar.bz2
chat-c63e027aece1270c8e1378ee27b015304d25f89d.zip
Fixing LDAP editing of attributes (#2824)
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 636400ce9..9db378341 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -136,7 +136,17 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha
if user.IsOAuthUser() {
user.Email = oldUser.Email
- } else if !user.IsLDAPUser() && user.Email != oldUser.Email {
+ } else if user.IsLDAPUser() {
+ if user.Username != oldUser.Username ||
+ user.FirstName != oldUser.FirstName ||
+ user.LastName != oldUser.LastName ||
+ user.Email != oldUser.Email {
+ result.Err = model.NewLocAppError("SqlUserStore.Update", "store.sql_user.update.can_not_change_ldap.app_error", nil, "user_id="+user.Id)
+ storeChannel <- result
+ close(storeChannel)
+ return
+ }
+ } else if user.Email != oldUser.Email {
user.EmailVerified = false
}