diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-09-01 17:05:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-01 17:05:20 -0400 |
commit | 5d7f2399620281dde1f4f85e1812aac9f18c96f9 (patch) | |
tree | beba814a678dff6c0fb1da9a728e49af144d9d24 /model/client.go | |
parent | 949e57076aa41584b4104abc2bed98c5f9d91165 (diff) | |
download | chat-5d7f2399620281dde1f4f85e1812aac9f18c96f9.tar.gz chat-5d7f2399620281dde1f4f85e1812aac9f18c96f9.tar.bz2 chat-5d7f2399620281dde1f4f85e1812aac9f18c96f9.zip |
Adding LDAP test connection button. Reordering LDAP settings. (#3912)
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index e2e003fe8..f43e5ad79 100644 --- a/model/client.go +++ b/model/client.go @@ -887,6 +887,19 @@ func (c *Client) TestEmail(config *Config) (*Result, *AppError) { } } +// TestLdap will run a connection test on the current LDAP settings. +// It will return the standard OK response if settings work. Otherwise +// it will return an appropriate error. +func (c *Client) TestLdap(config *Config) (*Result, *AppError) { + if r, err := c.DoApiPost("/admin/ldap_test", config.ToJson()); 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) GetComplianceReports() (*Result, *AppError) { if r, err := c.DoApiGet("/admin/compliance_reports", "", ""); err != nil { return nil, err |