summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-04-13 19:31:01 -0400
committerCorey Hulen <corey@hulen.com>2016-04-13 16:31:01 -0700
commit8c2c8921446c0e098fdbc1e4287fc5e9b475d88a (patch)
treefc83c5009bbbe7c73da19cd8e8dbfb69f99793cd /model
parentc801ce7cd74e7963dbe3b49601f84830dec16bd0 (diff)
downloadchat-8c2c8921446c0e098fdbc1e4287fc5e9b475d88a.tar.gz
chat-8c2c8921446c0e098fdbc1e4287fc5e9b475d88a.tar.bz2
chat-8c2c8921446c0e098fdbc1e4287fc5e9b475d88a.zip
Allow customization of LDAP login fields (#2692)
Diffstat (limited to 'model')
-rw-r--r--model/config.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index 26c71d07f..6803fe069 100644
--- a/model/config.go
+++ b/model/config.go
@@ -185,6 +185,10 @@ type LdapSettings struct {
// Advanced
SkipCertificateVerification *bool
QueryTimeout *int
+
+ // Customization
+ LoginFieldName *string
+ PasswordFieldName *string
}
type ComplianceSettings struct {
@@ -388,6 +392,16 @@ func (o *Config) SetDefaults() {
*o.LdapSettings.UserFilter = ""
}
+ if o.LdapSettings.LoginFieldName == nil {
+ o.LdapSettings.LoginFieldName = new(string)
+ *o.LdapSettings.LoginFieldName = ""
+ }
+
+ if o.LdapSettings.PasswordFieldName == nil {
+ o.LdapSettings.PasswordFieldName = new(string)
+ *o.LdapSettings.PasswordFieldName = ""
+ }
+
if o.ServiceSettings.SessionLengthWebInDays == nil {
o.ServiceSettings.SessionLengthWebInDays = new(int)
*o.ServiceSettings.SessionLengthWebInDays = 30