diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-06-28 20:11:33 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-06-28 16:11:33 -0800 |
commit | 6c5a8be6bfe1d6b9d8f71a6b0dc4d8cf93a03aab (patch) | |
tree | 450b4a8b0ef160e06a069165ef15b08b77bab016 /model/client.go | |
parent | b3b90a753166e1b2d6141cfd60b350bcd49c7253 (diff) | |
download | chat-6c5a8be6bfe1d6b9d8f71a6b0dc4d8cf93a03aab.tar.gz chat-6c5a8be6bfe1d6b9d8f71a6b0dc4d8cf93a03aab.tar.bz2 chat-6c5a8be6bfe1d6b9d8f71a6b0dc4d8cf93a03aab.zip |
Implementing server side of LDAP sync now button (#3430)
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index 80ab42dc4..8ed221627 100644 --- a/model/client.go +++ b/model/client.go @@ -860,6 +860,20 @@ func (c *Client) GetSystemAnalytics(name string) (*Result, *AppError) { } } +// Initiate immediate synchronization of LDAP users. +// The synchronization will be performed asynchronously and this function will +// always return OK unless you don't have permissions. +// You must be the system administrator to use this function. +func (c *Client) LdapSyncNow() (*Result, *AppError) { + if r, err := c.DoApiPost("/admin/ldap_sync_now", ""); err != nil { + return nil, err + } else { + defer closeBody(r) + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil + } +} + func (c *Client) CreateChannel(channel *Channel) (*Result, *AppError) { if r, err := c.DoApiPost(c.GetTeamRoute()+"/channels/create", channel.ToJson()); err != nil { return nil, err |