Merge pull request #7797 from stonezdj/fix_7793_v180

cherry-pick fix issue7793: ping ldap server is always success
This commit is contained in:
Wang Yan 2019-05-15 11:36:17 +08:00 committed by GitHub
commit 65d6e32415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,10 +79,10 @@ func (l *LdapAPI) Prepare() {
// Ping ...
func (l *LdapAPI) Ping() {
var err error
var ldapConfs = models.LdapConf{
LdapConnectionTimeout: 5,
}
var err error
l.Ctx.Input.CopyBody(1 << 32)
@ -90,7 +90,8 @@ func (l *LdapAPI) Ping() {
ldapSession := *l.ldapConfig
err = ldapSession.ConnectionTest()
} else {
isValid, err := l.DecodeJSONReqAndValidate(&ldapConfs)
var isValid bool
isValid, err = l.DecodeJSONReqAndValidate(&ldapConfs)
if !isValid {
l.SendBadRequestError(err)
return