Implementing server side of LDAP sync now button (#3430)

This commit is contained in:
Christopher Speller
2016-06-28 20:11:33 -04:00
committed by Corey Hulen
parent b3b90a7531
commit 6c5a8be6bf
3 changed files with 44 additions and 0 deletions

View File

@@ -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