From 9db4666a657bf137b371b9163a60e9c818ea31f3 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 27 Oct 2018 10:20:02 +0200 Subject: ldap: Add own ldap authentication --- utils/config.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'utils/config.go') diff --git a/utils/config.go b/utils/config.go index b7bd15e61..644167710 100644 --- a/utils/config.go +++ b/utils/config.go @@ -639,17 +639,15 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["PasswordRequireSymbol"] = strconv.FormatBool(*c.PasswordSettings.Symbol) props["CustomUrlSchemes"] = strings.Join(*c.DisplaySettings.CustomUrlSchemes, ",") + props["LdapNicknameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.NicknameAttribute != "") + props["LdapFirstNameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.FirstNameAttribute != "") + props["LdapLastNameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.LastNameAttribute != "") + if license != nil { props["ExperimentalHideTownSquareinLHS"] = strconv.FormatBool(*c.TeamSettings.ExperimentalHideTownSquareinLHS) props["ExperimentalTownSquareIsReadOnly"] = strconv.FormatBool(*c.TeamSettings.ExperimentalTownSquareIsReadOnly) props["ExperimentalEnableAuthenticationTransfer"] = strconv.FormatBool(*c.ServiceSettings.ExperimentalEnableAuthenticationTransfer) - if *license.Features.LDAP { - props["LdapNicknameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.NicknameAttribute != "") - props["LdapFirstNameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.FirstNameAttribute != "") - props["LdapLastNameAttributeSet"] = strconv.FormatBool(*c.LdapSettings.LastNameAttribute != "") - } - if *license.Features.MFA { props["EnforceMultifactorAuthentication"] = strconv.FormatBool(*c.ServiceSettings.EnforceMultifactorAuthentication) } @@ -783,15 +781,13 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticId string, license * props["CustomBrandText"] = *c.TeamSettings.CustomBrandText props["CustomDescriptionText"] = *c.TeamSettings.CustomDescriptionText - if license != nil { - if *license.Features.LDAP { - props["EnableLdap"] = strconv.FormatBool(*c.LdapSettings.Enable) - props["LdapLoginFieldName"] = *c.LdapSettings.LoginFieldName - props["LdapLoginButtonColor"] = *c.LdapSettings.LoginButtonColor - props["LdapLoginButtonBorderColor"] = *c.LdapSettings.LoginButtonBorderColor - props["LdapLoginButtonTextColor"] = *c.LdapSettings.LoginButtonTextColor - } + props["EnableLdap"] = strconv.FormatBool(*c.LdapSettings.Enable) + props["LdapLoginFieldName"] = *c.LdapSettings.LoginFieldName + props["LdapLoginButtonColor"] = *c.LdapSettings.LoginButtonColor + props["LdapLoginButtonBorderColor"] = *c.LdapSettings.LoginButtonBorderColor + props["LdapLoginButtonTextColor"] = *c.LdapSettings.LoginButtonTextColor + if license != nil { if *license.Features.MFA { props["EnableMultifactorAuthentication"] = strconv.FormatBool(*c.ServiceSettings.EnableMultifactorAuthentication) } -- cgit v1.2.3-1-g7c22