Implementing Activate User

This commit is contained in:
Chris Mann 2023-07-21 13:55:35 +02:00
parent 104f1be63f
commit 3a6b682b87
2 changed files with 5 additions and 3 deletions

View file

@ -6,6 +6,7 @@ package main
import (
"crypto/tls"
"fmt"
"log"
"net/http"
@ -23,6 +24,7 @@ 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
}

View file

@ -237,9 +237,9 @@ func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo {
func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn string, password string) (*LoginInfo, error) {
l := ldapOpen(w)
// if l == nil {
// return nil, nil
// }
if l == nil {
return nil, nil
}
err := l.Bind(user_dn, password)
if err != nil {