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 (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ func ldapOpen(w http.ResponseWriter) *ldap.Conn {
|
||||||
l, err := ldap.DialURL(config.LdapServerAddr)
|
l, err := ldap.DialURL(config.LdapServerAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
log.Printf(fmt.Sprintf("27: %v %v", err, l))
|
||||||
return nil
|
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) {
|
func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn string, password string) (*LoginInfo, error) {
|
||||||
l := ldapOpen(w)
|
l := ldapOpen(w)
|
||||||
// if l == nil {
|
if l == nil {
|
||||||
// return nil, nil
|
return nil, nil
|
||||||
// }
|
}
|
||||||
|
|
||||||
err := l.Bind(user_dn, password)
|
err := l.Bind(user_dn, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue