summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-03-14 16:07:58 -0700
committer=Corey Hulen <corey@hulen.com>2016-03-15 18:27:45 -0700
commit36b17bf99ddd35c0c223722f8b6f4f1c71b2235e (patch)
tree6bc07d42d19d1d7a5bef26864bb93a1bc91da5f1 /utils
parentea3f25924ea64a2dd1e73624c0d30824e1efb240 (diff)
downloadchat-36b17bf99ddd35c0c223722f8b6f4f1c71b2235e.tar.gz
chat-36b17bf99ddd35c0c223722f8b6f4f1c71b2235e.tar.bz2
chat-36b17bf99ddd35c0c223722f8b6f4f1c71b2235e.zip
PLT-2115 Adding compliance
Diffstat (limited to 'utils')
-rw-r--r--utils/config.go2
-rw-r--r--utils/html.go11
-rw-r--r--utils/i18n.go6
-rw-r--r--utils/license.go1
4 files changed, 18 insertions, 2 deletions
diff --git a/utils/config.go b/utils/config.go
index 63906c345..9624196be 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -238,5 +238,7 @@ func getClientConfig(c *model.Config) map[string]string {
props["AllowCorsFrom"] = *c.ServiceSettings.AllowCorsFrom
+ props["EnableCompliance"] = strconv.FormatBool(*c.ComplianceSettings.Enable)
+
return props
}
diff --git a/utils/html.go b/utils/html.go
index 4203160d5..e89cb12a0 100644
--- a/utils/html.go
+++ b/utils/html.go
@@ -23,7 +23,16 @@ type HTMLTemplate struct {
}
func InitHTML() {
- templatesDir := FindDir("templates")
+ InitHTMLWithDir("templates")
+}
+
+func InitHTMLWithDir(dir string) {
+
+ if htmlTemplates != nil {
+ return
+ }
+
+ templatesDir := FindDir(dir)
l4g.Debug(T("api.api.init.parsing_templates.debug"), templatesDir)
var err error
if htmlTemplates, err = template.ParseGlob(templatesDir + "*.html"); err != nil {
diff --git a/utils/i18n.go b/utils/i18n.go
index e809ae883..2503cd500 100644
--- a/utils/i18n.go
+++ b/utils/i18n.go
@@ -16,7 +16,11 @@ var T i18n.TranslateFunc
var locales map[string]string = make(map[string]string)
func InitTranslations() {
- i18nDirectory := FindDir("i18n")
+ InitTranslationsWithDir("i18n")
+}
+
+func InitTranslationsWithDir(dir string) {
+ i18nDirectory := FindDir(dir)
files, _ := ioutil.ReadDir(i18nDirectory)
for _, f := range files {
if filepath.Ext(f.Name()) == ".json" {
diff --git a/utils/license.go b/utils/license.go
index b1f15ad92..1dc8bf025 100644
--- a/utils/license.go
+++ b/utils/license.go
@@ -115,6 +115,7 @@ func getClientLicense(l *model.License) map[string]string {
props["Users"] = strconv.Itoa(*l.Features.Users)
props["LDAP"] = strconv.FormatBool(*l.Features.LDAP)
props["GoogleSSO"] = strconv.FormatBool(*l.Features.GoogleSSO)
+ props["Compliance"] = strconv.FormatBool(*l.Features.Compliance)
props["IssuedAt"] = strconv.FormatInt(l.IssuedAt, 10)
props["StartsAt"] = strconv.FormatInt(l.StartsAt, 10)
props["ExpiresAt"] = strconv.FormatInt(l.ExpiresAt, 10)