diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-06-03 09:33:59 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-06-03 09:33:59 -0400 |
commit | ea3342aa6c93579d41de3f6005c12a201b21ee6e (patch) | |
tree | 560ab58429ead414ffd3eb730d462e687db48d7f /store | |
parent | 87f357a54d0dccf09b6b6f20f64b08ef3ca2e1f2 (diff) | |
download | chat-ea3342aa6c93579d41de3f6005c12a201b21ee6e.tar.gz chat-ea3342aa6c93579d41de3f6005c12a201b21ee6e.tar.bz2 chat-ea3342aa6c93579d41de3f6005c12a201b21ee6e.zip |
Adding LDAP Syncronization (#3219)
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_user_store.go | 21 | ||||
-rw-r--r-- | store/store.go | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go index 11a915055..07a801dc6 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -793,6 +793,27 @@ func (us SqlUserStore) GetByAuth(authData *string, authService string) StoreChan return storeChannel } +func (us SqlUserStore) GetAllUsingAuthService(authService string) StoreChannel { + + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + var data []*model.User + + if _, err := us.GetReplica().Select(&data, "SELECT * FROM Users WHERE AuthService = :AuthService", map[string]interface{}{"AuthService": authService}); err != nil { + result.Err = model.NewLocAppError("SqlUserStore.GetByAuth", "store.sql_user.get_by_auth.other.app_error", nil, "authService="+authService+", "+err.Error()) + } + + result.Data = data + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} + func (us SqlUserStore) GetByUsername(username string) StoreChannel { storeChannel := make(StoreChannel) diff --git a/store/store.go b/store/store.go index ebbd2e454..7f4db396c 100644 --- a/store/store.go +++ b/store/store.go @@ -139,6 +139,7 @@ type UserStore interface { GetProfileByIds(userId []string) StoreChannel GetByEmail(email string) StoreChannel GetByAuth(authData *string, authService string) StoreChannel + GetAllUsingAuthService(authService string) StoreChannel GetByUsername(username string) StoreChannel GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail, ldapEnabled bool) StoreChannel VerifyEmail(userId string) StoreChannel |