summaryrefslogtreecommitdiffstats
path: root/store/sqlstore
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-10 09:46:09 -0700
committerGitHub <noreply@github.com>2018-05-10 09:46:09 -0700
commitd8dd271e43550ab043c2db36c274092d7819fcab (patch)
treee297c0534a9684d57fc254281cf5cbc3d7c08e0f /store/sqlstore
parentdb6b8f6238853c6e7e48dc8015a0b25f97ee232a (diff)
downloadchat-d8dd271e43550ab043c2db36c274092d7819fcab.tar.gz
chat-d8dd271e43550ab043c2db36c274092d7819fcab.tar.bz2
chat-d8dd271e43550ab043c2db36c274092d7819fcab.zip
MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID without losing their account (#8756)
* Adding LoginIdAttribute * Modifying LDAP to use loginIDAttribute. * Adding IDAttribute migration and AD objectGUID support. * Removing unused idea. * Fix typo.
Diffstat (limited to 'store/sqlstore')
-rw-r--r--store/sqlstore/user_store.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go
index f4ed3e400..a695e4aa8 100644
--- a/store/sqlstore/user_store.go
+++ b/store/sqlstore/user_store.go
@@ -819,13 +819,12 @@ func (us SqlUserStore) GetByUsername(username string) store.StoreChannel {
})
}
-func (us SqlUserStore) GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail, ldapEnabled bool) store.StoreChannel {
+func (us SqlUserStore) GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail bool) store.StoreChannel {
return store.Do(func(result *store.StoreResult) {
params := map[string]interface{}{
"LoginId": loginId,
"AllowSignInWithUsername": allowSignInWithUsername,
"AllowSignInWithEmail": allowSignInWithEmail,
- "LdapEnabled": ldapEnabled,
}
users := []*model.User{}
@@ -837,8 +836,7 @@ func (us SqlUserStore) GetForLogin(loginId string, allowSignInWithUsername, allo
Users
WHERE
(:AllowSignInWithUsername AND Username = :LoginId)
- OR (:AllowSignInWithEmail AND Email = :LoginId)
- OR (:LdapEnabled AND AuthService = '`+model.USER_AUTH_SERVICE_LDAP+`' AND AuthData = :LoginId)`,
+ OR (:AllowSignInWithEmail AND Email = :LoginId)`,
params); err != nil {
result.Err = model.NewAppError("SqlUserStore.GetForLogin", "store.sql_user.get_for_login.app_error", nil, err.Error(), http.StatusInternalServerError)
} else if len(users) == 1 {