Implementing Activate User
This commit is contained in:
parent
104f1be63f
commit
3a6b682b87
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
6
login.go
6
login.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue