diff options
Diffstat (limited to 'model')
-rw-r--r-- | model/client.go | 2 | ||||
-rw-r--r-- | model/config.go | 39 | ||||
-rw-r--r-- | model/team_test.go | 2 | ||||
-rw-r--r-- | model/utils_test.go | 8 |
4 files changed, 45 insertions, 6 deletions
diff --git a/model/client.go b/model/client.go index ac85b0d1c..d3f76817d 100644 --- a/model/client.go +++ b/model/client.go @@ -230,7 +230,7 @@ func (c *Client) CreateUser(user *User, hash string) (*Result, *AppError) { } func (c *Client) CreateUserFromSignup(user *User, data string, hash string) (*Result, *AppError) { - if r, err := c.DoApiPost("/users/create?d="+data+"&h="+hash, user.ToJson()); err != nil { + if r, err := c.DoApiPost("/users/create?d="+url.QueryEscape(data)+"&h="+hash, user.ToJson()); err != nil { return nil, err } else { return &Result{r.Header.Get(HEADER_REQUEST_ID), diff --git a/model/config.go b/model/config.go index a3ba812b0..9030f91ae 100644 --- a/model/config.go +++ b/model/config.go @@ -113,6 +113,15 @@ type PrivacySettings struct { ShowFullName bool } +type SupportSettings struct { + TermsOfServiceLink *string + PrivacyPolicyLink *string + AboutLink *string + HelpLink *string + ReportAProblemLink *string + SupportEmail *string +} + type TeamSettings struct { SiteName string MaxUsersPerTeam int @@ -132,6 +141,7 @@ type Config struct { EmailSettings EmailSettings RateLimitSettings RateLimitSettings PrivacySettings PrivacySettings + SupportSettings SupportSettings GitLabSettings SSOSettings } @@ -206,6 +216,35 @@ func (o *Config) SetDefaults() { *o.EmailSettings.PushNotificationServer = "" } + if o.SupportSettings.TermsOfServiceLink == nil { + o.SupportSettings.TermsOfServiceLink = new(string) + *o.SupportSettings.TermsOfServiceLink = "/static/help/terms.html" + } + + if o.SupportSettings.PrivacyPolicyLink == nil { + o.SupportSettings.PrivacyPolicyLink = new(string) + *o.SupportSettings.PrivacyPolicyLink = "/static/help/privacy.html" + } + + if o.SupportSettings.AboutLink == nil { + o.SupportSettings.AboutLink = new(string) + *o.SupportSettings.AboutLink = "/static/help/about.html" + } + + if o.SupportSettings.HelpLink == nil { + o.SupportSettings.HelpLink = new(string) + *o.SupportSettings.HelpLink = "/static/help/help.html" + } + + if o.SupportSettings.ReportAProblemLink == nil { + o.SupportSettings.ReportAProblemLink = new(string) + *o.SupportSettings.ReportAProblemLink = "/static/help/report_problem.html" + } + + if o.SupportSettings.SupportEmail == nil { + o.SupportSettings.SupportEmail = new(string) + *o.SupportSettings.SupportEmail = "feedback@mattermost.com" + } } func (o *Config) IsValid() *AppError { diff --git a/model/team_test.go b/model/team_test.go index 112d48a9d..4b691e76a 100644 --- a/model/team_test.go +++ b/model/team_test.go @@ -45,7 +45,7 @@ func TestTeamIsValid(t *testing.T) { t.Fatal("should be invalid") } - o.Email = "corey@hulen.com" + o.Email = "corey+test@hulen.com" o.DisplayName = strings.Repeat("01234567890", 20) if err := o.IsValid(true); err == nil { t.Fatal("should be invalid") diff --git a/model/utils_test.go b/model/utils_test.go index 1f1e5f023..aab535fc9 100644 --- a/model/utils_test.go +++ b/model/utils_test.go @@ -56,21 +56,21 @@ func TestMapJson(t *testing.T) { } func TestValidEmail(t *testing.T) { - if !IsValidEmail("corey@hulen.com") { + if !IsValidEmail("corey+test@hulen.com") { t.Error("email should be valid") } - if IsValidEmail("@corey@hulen.com") { + if IsValidEmail("@corey+test@hulen.com") { t.Error("should be invalid") } } func TestValidLower(t *testing.T) { - if !IsLower("corey@hulen.com") { + if !IsLower("corey+test@hulen.com") { t.Error("should be valid") } - if IsLower("Corey@hulen.com") { + if IsLower("Corey+test@hulen.com") { t.Error("should be invalid") } } |