Implementing Activate User

This commit is contained in:
Chris Mann 2023-07-21 13:59:12 +02:00
parent 4648c1347e
commit 7ff0a9d14e

View file

@ -21,6 +21,13 @@ 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 {
@ -29,11 +36,5 @@ 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
}