summaryrefslogtreecommitdiffstats
path: root/store/sql_session_store.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-24 08:14:30 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-24 08:14:30 -0400
commit54c7dba33dc707fa7013a87040c8a8e5d7b237e9 (patch)
tree6afeaf5fc7f7876f3e7677ed19a83d3e3dce3b44 /store/sql_session_store.go
parent56f76502e3edcc95f7a0e9c8fe5b3d523b33ee29 (diff)
parent00112cae5123b02eee79e8b991618ed5069e07b1 (diff)
downloadchat-54c7dba33dc707fa7013a87040c8a8e5d7b237e9.tar.gz
chat-54c7dba33dc707fa7013a87040c8a8e5d7b237e9.tar.bz2
chat-54c7dba33dc707fa7013a87040c8a8e5d7b237e9.zip
Merge pull request #765 from mattermost/PLT-349
PLT-349 adding team mgt to admin console
Diffstat (limited to 'store/sql_session_store.go')
-rw-r--r--store/sql_session_store.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/store/sql_session_store.go b/store/sql_session_store.go
index c1d2c852b..22411389d 100644
--- a/store/sql_session_store.go
+++ b/store/sql_session_store.go
@@ -140,6 +140,24 @@ func (me SqlSessionStore) Remove(sessionIdOrToken string) StoreChannel {
return storeChannel
}
+func (me SqlSessionStore) RemoveAllSessionsForTeam(teamId string) StoreChannel {
+ storeChannel := make(StoreChannel)
+
+ go func() {
+ result := StoreResult{}
+
+ _, err := me.GetMaster().Exec("DELETE FROM Sessions WHERE TeamId = :TeamId", map[string]interface{}{"TeamId": teamId})
+ if err != nil {
+ result.Err = model.NewAppError("SqlSessionStore.RemoveAllSessionsForTeam", "We couldn't remove all the sessions for the team", "id="+teamId+", err="+err.Error())
+ }
+
+ storeChannel <- result
+ close(storeChannel)
+ }()
+
+ return storeChannel
+}
+
func (me SqlSessionStore) CleanUpExpiredSessions(userId string) StoreChannel {
storeChannel := make(StoreChannel)