diff options
author | Martin Kraft <martinkraft@gmail.com> | 2018-05-22 12:54:00 -0400 |
---|---|---|
committer | Martin Kraft <martinkraft@gmail.com> | 2018-05-22 12:54:00 -0400 |
commit | 4c683aff7627040ff811f065848a820b2cb19d59 (patch) | |
tree | 668061e8acfd8827fd02bab18a998b7986944296 /app/login.go | |
parent | eb78d273f39202046fa71555a5a19b0ec8a95cb3 (diff) | |
parent | 1af1bce6199597bb2d41ddcdc00ef0f28a73c83e (diff) | |
download | chat-4c683aff7627040ff811f065848a820b2cb19d59.tar.gz chat-4c683aff7627040ff811f065848a820b2cb19d59.tar.bz2 chat-4c683aff7627040ff811f065848a820b2cb19d59.zip |
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'app/login.go')
-rw-r--r-- | app/login.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/login.go b/app/login.go index a07056c1e..3001e1f4d 100644 --- a/app/login.go +++ b/app/login.go @@ -67,9 +67,11 @@ func (a *App) GetUserForLogin(id, loginId string) (*model.User, *model.AppError) return result.Data.(*model.User), nil } - // Try to get the user with LDAP - if user, err := a.Ldap.GetUser(loginId); err == nil { - return user, nil + // Try to get the user with LDAP if enabled + if *a.Config().LdapSettings.Enable && a.Ldap != nil { + if user, err := a.Ldap.GetUser(loginId); err == nil { + return user, nil + } } return nil, model.NewAppError("GetUserForLogin", "store.sql_user.get_for_login.app_error", nil, "", http.StatusBadRequest) |