Implementing Activate User
This commit is contained in:
parent
780b1ec465
commit
8a5539a143
1 changed files with 4 additions and 3 deletions
7
login.go
7
login.go
|
@ -213,15 +213,16 @@ func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo {
|
||||||
if strings.EqualFold(username, config.AdminAccount) {
|
if strings.EqualFold(username, config.AdminAccount) {
|
||||||
user_dn = username
|
user_dn = username
|
||||||
}
|
}
|
||||||
loginInfo := *doLogin(w, r, username, user_dn, password)
|
loginInfo := doLogin(w, r, username, user_dn, password)
|
||||||
return &loginInfo
|
return &loginInfo
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
http.Error(w, "Unsupported method", http.StatusBadRequest)
|
http.Error(w, "Unsupported method", http.StatusBadRequest)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn string, password string) *LoginInfo {
|
func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn string, password string) LoginInfo {
|
||||||
l := ldapOpen(w)
|
l := ldapOpen(w)
|
||||||
if l == nil {
|
if l == nil {
|
||||||
return nil
|
return nil
|
||||||
|
@ -260,7 +261,7 @@ func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn st
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return &LoginInfo{
|
return LoginInfo{
|
||||||
DN: user_dn,
|
DN: user_dn,
|
||||||
Username: username,
|
Username: username,
|
||||||
Password: password,
|
Password: password,
|
||||||
|
|
Loading…
Reference in a new issue