From b013f02209c7c128a35d1c54f2d4a7d6a9701f72 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 13 Jan 2016 14:58:49 -0800 Subject: Added ability to sign in via username; separated email sign in and sign up config settings --- model/client.go | 8 ++++++++ model/config.go | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'model') diff --git a/model/client.go b/model/client.go index d31ac1592..3b72f65e4 100644 --- a/model/client.go +++ b/model/client.go @@ -280,6 +280,14 @@ func (c *Client) LoginByEmail(name string, email string, password string) (*Resu return c.login(m) } +func (c *Client) LoginByUsername(name string, username string, password string) (*Result, *AppError) { + m := make(map[string]string) + m["name"] = name + m["username"] = username + m["password"] = password + return c.login(m) +} + func (c *Client) LoginByEmailWithDevice(name string, email string, password string, deviceId string) (*Result, *AppError) { m := make(map[string]string) m["name"] = name diff --git a/model/config.go b/model/config.go index 5c8604ff1..a6d1c21dc 100644 --- a/model/config.go +++ b/model/config.go @@ -97,6 +97,8 @@ type FileSettings struct { type EmailSettings struct { EnableSignUpWithEmail bool + EnableSignInWithEmail *bool + EnableSignInWithUsername *bool SendEmailNotifications bool RequireEmailVerification bool FeedbackName string @@ -258,6 +260,21 @@ func (o *Config) SetDefaults() { *o.TeamSettings.EnableTeamListing = false } + if o.EmailSettings.EnableSignInWithEmail == nil { + o.EmailSettings.EnableSignInWithEmail = new(bool) + + if o.EmailSettings.EnableSignUpWithEmail == true { + *o.EmailSettings.EnableSignInWithEmail = true + } else { + *o.EmailSettings.EnableSignInWithEmail = false + } + } + + if o.EmailSettings.EnableSignInWithUsername == nil { + o.EmailSettings.EnableSignInWithUsername = new(bool) + *o.EmailSettings.EnableSignInWithUsername = false + } + if o.EmailSettings.SendPushNotifications == nil { o.EmailSettings.SendPushNotifications = new(bool) *o.EmailSettings.SendPushNotifications = false -- cgit v1.2.3-1-g7c22 From d153d661db7d4349d69824d318aa9ad571970606 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 2 Feb 2016 16:49:27 -0500 Subject: Add basic server audit tab to system console for EE --- model/client.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'model') diff --git a/model/client.go b/model/client.go index d31ac1592..4f6c41e05 100644 --- a/model/client.go +++ b/model/client.go @@ -398,6 +398,15 @@ func (c *Client) GetLogs() (*Result, *AppError) { } } +func (c *Client) GetAllAudits() (*Result, *AppError) { + if r, err := c.DoApiGet("/admin/audits", "", ""); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), AuditsFromJson(r.Body)}, nil + } +} + func (c *Client) GetClientProperties() (*Result, *AppError) { if r, err := c.DoApiGet("/admin/client_props", "", ""); err != nil { return nil, err -- cgit v1.2.3-1-g7c22