Implementing Activate User
This commit is contained in:
parent
3a6b682b87
commit
4648c1347e
1 changed files with 6 additions and 7 deletions
|
@ -21,13 +21,6 @@ func logRequest(handler http.Handler) http.Handler {
|
|||
}
|
||||
|
||||
func ldapOpen(w http.ResponseWriter) *ldap.Conn {
|
||||
l, err := ldap.DialURL(config.LdapServerAddr)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
log.Printf(fmt.Sprintf("27: %v %v", err, l))
|
||||
return nil
|
||||
}
|
||||
|
||||
if config.LdapTLS {
|
||||
err = l.StartTLS(&tls.Config{InsecureSkipVerify: true})
|
||||
if err != nil {
|
||||
|
@ -36,5 +29,11 @@ func ldapOpen(w http.ResponseWriter) *ldap.Conn {
|
|||
}
|
||||
}
|
||||
|
||||
l, err := ldap.DialURL(config.LdapServerAddr)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
log.Printf(fmt.Sprintf("27: %v %v", err, l))
|
||||
return nil
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue