Implementing Activate User
This commit is contained in:
parent
4648c1347e
commit
7ff0a9d14e
1 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue