Fixed Change Password Bug

This commit is contained in:
Chris Mann 2023-07-25 14:53:14 +02:00
parent 026ffa1376
commit 020dc0f6d4
3 changed files with 6 additions and 6 deletions

View file

@ -93,7 +93,7 @@ func passwordLost(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
log.Printf(fmt.Sprintf("passwordLost 84 : %v", user))
// log.Printf(fmt.Sprintf("passwordLost 85 : %v", searchRes.Entries[0]))
// For some reason I get here even if the entry exists already
// return err
return err
}
}
err = passwd(user, config, ldapConn)

View file

@ -15,6 +15,7 @@ type HomePageData struct {
}
func handleHome(w http.ResponseWriter, r *http.Request) {
templateHome := getTemplate("home.html")
login := checkLogin(w, r)
if login == nil {
@ -22,8 +23,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) {
return
}
templateHome := getTemplate("home.html")
data := &HomePageData{
data := HomePageData{
Login: login,
BaseDN: config.BaseDN,
Org: config.Org,

View file

@ -23,6 +23,8 @@ func checkLogin(w http.ResponseWriter, r *http.Request) *LoginStatus {
Username: username.(string),
Password: password.(string),
}
} else {
return nil
}
}
@ -30,9 +32,7 @@ func checkLogin(w http.ResponseWriter, r *http.Request) *LoginStatus {
if l == nil {
return nil
}
if login_info == nil {
return nil
}
if err != nil {
log.Printf("checkLogin ldapOpen : %v", err)
log.Printf("checkLogin ldapOpen : %v", session)