summaryrefslogtreecommitdiffstats
path: root/app/ldap.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-02-06 17:25:49 -0600
committerGitHub <noreply@github.com>2018-02-06 17:25:49 -0600
commit1ec295f88ca99e9423ffd91019cecf802ae3dc77 (patch)
tree05abc364fefdc6b1088bfb4a307ba11db0dc427f /app/ldap.go
parent034dbc07e3068c482e654b6a1a8fcbe4b01c44f3 (diff)
downloadchat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.tar.gz
chat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.tar.bz2
chat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.zip
add App.License, remove utils.IsLicensed / utils.License calls (#8203)
Diffstat (limited to 'app/ldap.go')
-rw-r--r--app/ldap.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/ldap.go b/app/ldap.go
index 49f3d034a..179529c52 100644
--- a/app/ldap.go
+++ b/app/ldap.go
@@ -14,7 +14,7 @@ import (
func (a *App) SyncLdap() {
a.Go(func() {
- if utils.IsLicensed() && *utils.License().Features.LDAP && *a.Config().LdapSettings.EnableSync {
+ if license := a.License(); license != nil && *license.Features.LDAP && *a.Config().LdapSettings.EnableSync {
if ldapI := a.Ldap; ldapI != nil {
ldapI.StartSynchronizeJob(false)
} else {
@@ -25,7 +25,8 @@ func (a *App) SyncLdap() {
}
func (a *App) TestLdap() *model.AppError {
- if ldapI := a.Ldap; ldapI != nil && utils.IsLicensed() && *utils.License().Features.LDAP && (*a.Config().LdapSettings.Enable || *a.Config().LdapSettings.EnableSync) {
+ license := a.License()
+ if ldapI := a.Ldap; ldapI != nil && license != nil && *license.Features.LDAP && (*a.Config().LdapSettings.Enable || *a.Config().LdapSettings.EnableSync) {
if err := ldapI.RunTest(); err != nil {
err.StatusCode = 500
return err
@@ -39,7 +40,7 @@ func (a *App) TestLdap() *model.AppError {
}
func (a *App) SwitchEmailToLdap(email, password, code, ldapId, ldapPassword string) (string, *model.AppError) {
- if utils.IsLicensed() && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
+ if a.License() != nil && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
return "", model.NewAppError("emailToLdap", "api.user.email_to_ldap.not_available.app_error", nil, "", http.StatusForbidden)
}
@@ -75,7 +76,7 @@ func (a *App) SwitchEmailToLdap(email, password, code, ldapId, ldapPassword stri
}
func (a *App) SwitchLdapToEmail(ldapPassword, code, email, newPassword string) (string, *model.AppError) {
- if utils.IsLicensed() && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
+ if a.License() != nil && !*a.Config().ServiceSettings.ExperimentalEnableAuthenticationTransfer {
return "", model.NewAppError("ldapToEmail", "api.user.ldap_to_email.not_available.app_error", nil, "", http.StatusForbidden)
}