summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-03 10:45:58 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-03 10:45:58 -0800
commitbdfa4715d65ed4b4e903a1eb4c83eba6c95455d1 (patch)
tree1626d089802a92ee208b6e7fa056378e40568a92 /model
parent581785f5044eecdc7cf664e4c7fc59efc6babc96 (diff)
parent9bba6c79882d1f5d14b98052caf59a11fc2388d5 (diff)
downloadchat-bdfa4715d65ed4b4e903a1eb4c83eba6c95455d1.tar.gz
chat-bdfa4715d65ed4b4e903a1eb4c83eba6c95455d1.tar.bz2
chat-bdfa4715d65ed4b4e903a1eb4c83eba6c95455d1.zip
Merge branch 'master' into PLT-1429
Diffstat (limited to 'model')
-rw-r--r--model/client.go17
-rw-r--r--model/config.go17
2 files changed, 34 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go
index a271e6162..560e47b76 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
@@ -443,6 +451,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
diff --git a/model/config.go b/model/config.go
index f518e8f8d..acb525abf 100644
--- a/model/config.go
+++ b/model/config.go
@@ -99,6 +99,8 @@ type FileSettings struct {
type EmailSettings struct {
EnableSignUpWithEmail bool
+ EnableSignInWithEmail *bool
+ EnableSignInWithUsername *bool
SendEmailNotifications bool
RequireEmailVerification bool
FeedbackName string
@@ -260,6 +262,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