Implementing Activate User

This commit is contained in:
Chris Mann 2023-07-21 13:58:33 +02:00
parent 3a6b682b87
commit 4648c1347e

View file

@ -21,13 +21,6 @@ func logRequest(handler http.Handler) http.Handler {
} }
func ldapOpen(w http.ResponseWriter) *ldap.Conn { 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 { if config.LdapTLS {
err = l.StartTLS(&tls.Config{InsecureSkipVerify: true}) err = l.StartTLS(&tls.Config{InsecureSkipVerify: true})
if err != nil { 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 return l
} }