From ea3342aa6c93579d41de3f6005c12a201b21ee6e Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 3 Jun 2016 09:33:59 -0400 Subject: Adding LDAP Syncronization (#3219) --- store/sql_user_store.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'store/sql_user_store.go') 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) -- cgit v1.2.3-1-g7c22