summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/config.go13
-rw-r--r--utils/license.go4
-rw-r--r--utils/textgeneration.go20
3 files changed, 23 insertions, 14 deletions
diff --git a/utils/config.go b/utils/config.go
index 8ff328008..1ae658b16 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -57,6 +57,14 @@ func FindDir(dir string) string {
return fileName + "/"
}
+func DisableDebugLogForTest() {
+ l4g.Global["stdout"].Level = l4g.WARNING
+}
+
+func EnableDebugLogForTest() {
+ l4g.Global["stdout"].Level = l4g.DEBUG
+}
+
func ConfigureCmdLineLog() {
ls := model.LogSettings{}
ls.EnableConsole = true
@@ -199,11 +207,10 @@ func getClientConfig(c *model.Config) map[string]string {
props["SiteName"] = c.TeamSettings.SiteName
props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation)
props["EnableUserCreation"] = strconv.FormatBool(c.TeamSettings.EnableUserCreation)
+ props["EnableOpenServer"] = strconv.FormatBool(*c.TeamSettings.EnableOpenServer)
props["RestrictTeamNames"] = strconv.FormatBool(*c.TeamSettings.RestrictTeamNames)
- props["EnableTeamListing"] = strconv.FormatBool(*c.TeamSettings.EnableTeamListing)
props["EnableOAuthServiceProvider"] = strconv.FormatBool(c.ServiceSettings.EnableOAuthServiceProvider)
-
props["SegmentDeveloperKey"] = c.ServiceSettings.SegmentDeveloperKey
props["GoogleDeveloperKey"] = c.ServiceSettings.GoogleDeveloperKey
props["EnableIncomingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableIncomingWebhooks)
@@ -242,7 +249,7 @@ func getClientConfig(c *model.Config) map[string]string {
props["AllowCorsFrom"] = *c.ServiceSettings.AllowCorsFrom
- if License.Features != nil {
+ if IsLicensed {
if *License.Features.CustomBrand {
props["EnableCustomBrand"] = strconv.FormatBool(*c.TeamSettings.EnableCustomBrand)
props["CustomBrandText"] = *c.TeamSettings.CustomBrandText
diff --git a/utils/license.go b/utils/license.go
index ba323d9b4..d3654932f 100644
--- a/utils/license.go
+++ b/utils/license.go
@@ -21,7 +21,9 @@ import (
)
var IsLicensed bool = false
-var License *model.License = &model.License{}
+var License *model.License = &model.License{
+ Features: new(model.Features),
+}
var ClientLicense map[string]string = map[string]string{"IsLicensed": "false"}
var publicKey []byte = []byte(`-----BEGIN PUBLIC KEY-----
diff --git a/utils/textgeneration.go b/utils/textgeneration.go
index 31b6517b8..96c43f402 100644
--- a/utils/textgeneration.go
+++ b/utils/textgeneration.go
@@ -473,16 +473,16 @@ func RandString(l int, charset string) string {
return string(ret)
}
-func RandomEmail(length Range, charset string) string {
- emaillen := RandIntFromRange(length)
- username := RandString(emaillen, charset)
- domain := "simulator.amazonses.com"
- return "success+" + username + "@" + domain
-}
-
-func FuzzEmail() string {
- return FUZZY_STRINGS_EMAILS[RandIntFromRange(Range{0, len(FUZZY_STRINGS_EMAILS) - 1})]
-}
+// func RandomEmail(length Range, charset string) string {
+// emaillen := RandIntFromRange(length)
+// username := RandString(emaillen, charset)
+// domain := "simulator.amazonses.com"
+// return "success+" + username + "@" + domain
+// }
+
+// func FuzzEmail() string {
+// return FUZZY_STRINGS_EMAILS[RandIntFromRange(Range{0, len(FUZZY_STRINGS_EMAILS) - 1})]
+// }
func RandomName(length Range, charset string) string {
namelen := RandIntFromRange(length)