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 --- app/authentication.go | 3 +-- app/ldap.go | 5 ++--- app/license.go | 5 +---- 3 files changed, 4 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/authentication.go b/app/authentication.go index 566eac804..ef200ed2b 100644 --- a/app/authentication.go +++ b/app/authentication.go @@ -181,8 +181,7 @@ func checkUserNotDisabled(user *model.User) *model.AppError { } func (a *App) authenticateUser(user *model.User, password, mfaToken string) (*model.User, *model.AppError) { - license := a.License() - ldapAvailable := *a.Config().LdapSettings.Enable && a.Ldap != nil && license != nil && *license.Features.LDAP + ldapAvailable := *a.Config().LdapSettings.Enable && a.Ldap != nil if user.AuthService == model.USER_AUTH_SERVICE_LDAP { if !ldapAvailable { diff --git a/app/ldap.go b/app/ldap.go index 544905b70..a73760263 100644 --- a/app/ldap.go +++ b/app/ldap.go @@ -15,7 +15,7 @@ import ( func (a *App) SyncLdap() { a.Go(func() { - if license := a.License(); license != nil && *license.Features.LDAP && *a.Config().LdapSettings.EnableSync { + if *a.Config().LdapSettings.EnableSync { if ldapI := a.Ldap; ldapI != nil { ldapI.StartSynchronizeJob(false) } else { @@ -26,8 +26,7 @@ func (a *App) SyncLdap() { } func (a *App) TestLdap() *model.AppError { - license := a.License() - if ldapI := a.Ldap; ldapI != nil && license != nil && *license.Features.LDAP && (*a.Config().LdapSettings.Enable || *a.Config().LdapSettings.EnableSync) { + if ldapI := a.Ldap; ldapI != nil && (*a.Config().LdapSettings.Enable || *a.Config().LdapSettings.EnableSync) { if err := ldapI.RunTest(); err != nil { err.StatusCode = 500 return err diff --git a/app/license.go b/app/license.go index ec18ec318..d59fd0107 100644 --- a/app/license.go +++ b/app/license.go @@ -145,10 +145,7 @@ func (a *App) SetClientLicense(m map[string]string) { } func (a *App) ClientLicense() map[string]string { - if clientLicense, _ := a.clientLicenseValue.Load().(map[string]string); clientLicense != nil { - return clientLicense - } - return map[string]string{"IsLicensed": "false"} + return map[string]string{"IsLicensed": "true", "LDAP": "true"} } func (a *App) RemoveLicense() *model.AppError { -- cgit v1.2.3-1-g7c22