Commit 99c0a5a4 authored by stonezdj's avatar stonezdj
Browse files

fix issue7793: ping ldap server is always success

Signed-off-by: default avatarstonezdj <stonezdj@gmail.com>
parent 47f24cab
Showing with 3 additions and 2 deletions
+3 -2
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment