summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-06-13 15:29:24 -0400
committerJoramWilander <jwawilander@gmail.com>2016-06-13 15:29:24 -0400
commit5af526c259d9c6477d67eb8f8a1e7b86270c7294 (patch)
tree97cc595107026a1f19d6fd6e35627dda23979aa3 /model
parentbb5ca5a8780f9259306d881e85760de8b87ddea8 (diff)
parent974238231b9cdbd39a825ec8e9299fbb0b51f6b8 (diff)
downloadchat-5af526c259d9c6477d67eb8f8a1e7b86270c7294.tar.gz
chat-5af526c259d9c6477d67eb8f8a1e7b86270c7294.tar.bz2
chat-5af526c259d9c6477d67eb8f8a1e7b86270c7294.zip
Merge branch 'release-3.1'
Conflicts: webapp/components/create_comment.jsx
Diffstat (limited to 'model')
-rw-r--r--model/config.go100
-rw-r--r--model/version.go1
2 files changed, 76 insertions, 25 deletions
diff --git a/model/config.go b/model/config.go
index b9177204b..08510fc44 100644
--- a/model/config.go
+++ b/model/config.go
@@ -6,6 +6,7 @@ package model
import (
"encoding/json"
"io"
+ "strings"
)
const (
@@ -35,6 +36,15 @@ const (
FAKE_SETTING = "********************************"
)
+// should match the values in webapp/i18n/i18n.jsx
+var LOCALES = []string{
+ "en",
+ "es",
+ "fr",
+ "ja",
+ "pt-BR",
+}
+
type ServiceSettings struct {
ListenAddress string
MaximumLoginAttempts int
@@ -420,19 +430,39 @@ func (o *Config) SetDefaults() {
*o.SupportSettings.SupportEmail = "feedback@mattermost.com"
}
+ if o.LdapSettings.Enable == nil {
+ o.LdapSettings.Enable = new(bool)
+ *o.LdapSettings.Enable = false
+ }
+
+ if o.LdapSettings.LdapServer == nil {
+ o.LdapSettings.LdapServer = new(string)
+ *o.LdapSettings.LdapServer = ""
+ }
+
if o.LdapSettings.LdapPort == nil {
o.LdapSettings.LdapPort = new(int)
*o.LdapSettings.LdapPort = 389
}
- if o.LdapSettings.QueryTimeout == nil {
- o.LdapSettings.QueryTimeout = new(int)
- *o.LdapSettings.QueryTimeout = 60
+ if o.LdapSettings.ConnectionSecurity == nil {
+ o.LdapSettings.ConnectionSecurity = new(string)
+ *o.LdapSettings.ConnectionSecurity = ""
}
- if o.LdapSettings.Enable == nil {
- o.LdapSettings.Enable = new(bool)
- *o.LdapSettings.Enable = false
+ if o.LdapSettings.BaseDN == nil {
+ o.LdapSettings.BaseDN = new(string)
+ *o.LdapSettings.BaseDN = ""
+ }
+
+ if o.LdapSettings.BindUsername == nil {
+ o.LdapSettings.BindUsername = new(string)
+ *o.LdapSettings.BindUsername = ""
+ }
+
+ if o.LdapSettings.BindPassword == nil {
+ o.LdapSettings.BindPassword = new(string)
+ *o.LdapSettings.BindPassword = ""
}
if o.LdapSettings.UserFilter == nil {
@@ -440,9 +470,29 @@ func (o *Config) SetDefaults() {
*o.LdapSettings.UserFilter = ""
}
- if o.LdapSettings.LoginFieldName == nil {
- o.LdapSettings.LoginFieldName = new(string)
- *o.LdapSettings.LoginFieldName = ""
+ if o.LdapSettings.FirstNameAttribute == nil {
+ o.LdapSettings.FirstNameAttribute = new(string)
+ *o.LdapSettings.FirstNameAttribute = ""
+ }
+
+ if o.LdapSettings.LastNameAttribute == nil {
+ o.LdapSettings.LastNameAttribute = new(string)
+ *o.LdapSettings.LastNameAttribute = ""
+ }
+
+ if o.LdapSettings.EmailAttribute == nil {
+ o.LdapSettings.EmailAttribute = new(string)
+ *o.LdapSettings.EmailAttribute = ""
+ }
+
+ if o.LdapSettings.NicknameAttribute == nil {
+ o.LdapSettings.NicknameAttribute = new(string)
+ *o.LdapSettings.NicknameAttribute = ""
+ }
+
+ if o.LdapSettings.IdAttribute == nil {
+ o.LdapSettings.IdAttribute = new(string)
+ *o.LdapSettings.IdAttribute = ""
}
if o.LdapSettings.SyncIntervalMinutes == nil {
@@ -450,6 +500,21 @@ func (o *Config) SetDefaults() {
*o.LdapSettings.SyncIntervalMinutes = 60
}
+ if o.LdapSettings.SkipCertificateVerification == nil {
+ o.LdapSettings.SkipCertificateVerification = new(bool)
+ *o.LdapSettings.SkipCertificateVerification = false
+ }
+
+ if o.LdapSettings.QueryTimeout == nil {
+ o.LdapSettings.QueryTimeout = new(int)
+ *o.LdapSettings.QueryTimeout = 60
+ }
+
+ if o.LdapSettings.LoginFieldName == nil {
+ o.LdapSettings.LoginFieldName = new(string)
+ *o.LdapSettings.LoginFieldName = ""
+ }
+
if o.ServiceSettings.SessionLengthWebInDays == nil {
o.ServiceSettings.SessionLengthWebInDays = new(int)
*o.ServiceSettings.SessionLengthWebInDays = 30
@@ -515,21 +580,6 @@ func (o *Config) SetDefaults() {
*o.ComplianceSettings.EnableDaily = false
}
- if o.LdapSettings.ConnectionSecurity == nil {
- o.LdapSettings.ConnectionSecurity = new(string)
- *o.LdapSettings.ConnectionSecurity = ""
- }
-
- if o.LdapSettings.SkipCertificateVerification == nil {
- o.LdapSettings.SkipCertificateVerification = new(bool)
- *o.LdapSettings.SkipCertificateVerification = false
- }
-
- if o.LdapSettings.NicknameAttribute == nil {
- o.LdapSettings.NicknameAttribute = new(string)
- *o.LdapSettings.NicknameAttribute = ""
- }
-
if o.LocalizationSettings.DefaultServerLocale == nil {
o.LocalizationSettings.DefaultServerLocale = new(string)
*o.LocalizationSettings.DefaultServerLocale = DEFAULT_LOCALE
@@ -542,7 +592,7 @@ func (o *Config) SetDefaults() {
if o.LocalizationSettings.AvailableLocales == nil {
o.LocalizationSettings.AvailableLocales = new(string)
- *o.LocalizationSettings.AvailableLocales = *o.LocalizationSettings.DefaultClientLocale
+ *o.LocalizationSettings.AvailableLocales = strings.Join(LOCALES, ",")
}
}
diff --git a/model/version.go b/model/version.go
index dde9eccd7..d486f5c57 100644
--- a/model/version.go
+++ b/model/version.go
@@ -13,6 +13,7 @@ import (
// It should be maitained in chronological order with most current
// release at the front of the list.
var versions = []string{
+ "3.1.0",
"3.0.0",
"2.2.0",
"2.1.0",