diff options
-rw-r--r-- | model/user.go | 9 | ||||
-rw-r--r-- | store/sql_user_store.go | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/model/user.go b/model/user.go index f8f2fdb70..173fe2b4e 100644 --- a/model/user.go +++ b/model/user.go @@ -352,7 +352,14 @@ func IsInRole(userRoles string, inRole string) bool { } func (u *User) IsSSOUser() bool { - if len(u.AuthData) != 0 && len(u.AuthService) != 0 { + if len(u.AuthData) != 0 && len(u.AuthService) != 0 && u.AuthService != USER_AUTH_SERVICE_LDAP { + return true + } + return false +} + +func (u *User) IsLDAPUser() bool { + if u.AuthService == USER_AUTH_SERVICE_LDAP { return true } return false diff --git a/store/sql_user_store.go b/store/sql_user_store.go index 33d1887ad..957921b9e 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -155,7 +155,7 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha if user.IsSSOUser() { user.Email = oldUser.Email - } else if user.Email != oldUser.Email { + } else if !user.IsLDAPUser() && user.Email != oldUser.Email { user.EmailVerified = false } |