summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-06-03 09:33:59 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-06-03 09:33:59 -0400
commitea3342aa6c93579d41de3f6005c12a201b21ee6e (patch)
tree560ab58429ead414ffd3eb730d462e687db48d7f /store/sql_user_store.go
parent87f357a54d0dccf09b6b6f20f64b08ef3ca2e1f2 (diff)
downloadchat-ea3342aa6c93579d41de3f6005c12a201b21ee6e.tar.gz
chat-ea3342aa6c93579d41de3f6005c12a201b21ee6e.tar.bz2
chat-ea3342aa6c93579d41de3f6005c12a201b21ee6e.zip
Adding LDAP Syncronization (#3219)
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go21
1 files changed, 21 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)