summaryrefslogtreecommitdiffstats
path: root/app/ldap.go
diff options
context:
space:
mode:
authorChris Duarte <csduarte@users.noreply.github.com>2017-11-28 11:46:48 -0800
committerChristopher Speller <crspeller@gmail.com>2017-11-28 11:46:48 -0800
commit27ba68a7894d5204b8d75dc7353774977d62fa15 (patch)
tree28af6c0900a1967ee8145575daca57c76f781d79 /app/ldap.go
parent785a410936daff5db7fba07dc5735bd74dd158bb (diff)
downloadchat-27ba68a7894d5204b8d75dc7353774977d62fa15.tar.gz
chat-27ba68a7894d5204b8d75dc7353774977d62fa15.tar.bz2
chat-27ba68a7894d5204b8d75dc7353774977d62fa15.zip
Add Config to disable Auth Transfers. (#7843)
* Add Config to disable Auth Transfers. * Set config ExperimentalEnableAuthenticationTransfer behind an E20 license restriction
Diffstat (limited to 'app/ldap.go')
-rw-r--r--app/ldap.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/ldap.go b/app/ldap.go
index a01a4aeb6..49f3d034a 100644
--- a/app/ldap.go
+++ b/app/ldap.go
@@ -39,6 +39,10 @@ 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 {
+ return "", model.NewAppError("emailToLdap", "api.user.email_to_ldap.not_available.app_error", nil, "", http.StatusForbidden)
+ }
+
user, err := a.GetUserByEmail(email)
if err != nil {
return "", err
@@ -71,6 +75,10 @@ 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 {
+ return "", model.NewAppError("ldapToEmail", "api.user.ldap_to_email.not_available.app_error", nil, "", http.StatusForbidden)
+ }
+
user, err := a.GetUserByEmail(email)
if err != nil {
return "", err