From 1e44165fad0af8a8e3f35b59382c601839026536 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Tue, 25 Jul 2023 08:46:12 +0200 Subject: [PATCH] Fixed Change Password Bug --- invite.go | 6 +++--- model-user.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/invite.go b/invite.go index 0b1db9a..ea6d4de 100644 --- a/invite.go +++ b/invite.go @@ -96,17 +96,17 @@ func handleLostPassword(w http.ResponseWriter, r *http.Request) { } ldapConn, err := openNewUserLdap(config) if err != nil { - log.Printf(fmt.Sprintf("handleLostPassword : %v %v", err, ldapConn)) + log.Printf(fmt.Sprintf("handleLostPassword 99 : %v %v", err, ldapConn)) data.ErrorMessage = err.Error() } err = passwordLost(user, config, ldapConn) if err != nil { - log.Printf(fmt.Sprintf("handleLostPassword : %v %v", err, ldapConn)) + log.Printf(fmt.Sprintf("handleLostPassword 104 : %v %v", err, ldapConn)) data.ErrorMessage = err.Error() } else { err = ldapConn.Bind(config.NewUserDN, config.NewUserPassword) if err != nil { - log.Printf(fmt.Sprintf("handleLostPassword : %v %v", err, ldapConn)) + log.Printf(fmt.Sprintf("handleLostPassword 109 : %v %v", err, ldapConn)) data.ErrorMessage = err.Error() } else { data.Success = true diff --git a/model-user.go b/model-user.go index 377264b..c43a441 100644 --- a/model-user.go +++ b/model-user.go @@ -159,6 +159,8 @@ func modify(user User, config *ConfigFile, ldapConn *ldap.Conn) error { func passwd(user User, config *ConfigFile, ldapConn *ldap.Conn) error { passwordModifyRequest := ldap.NewPasswordModifyRequest(user.DN, "", user.Password) _, err := ldapConn.PasswordModify(passwordModifyRequest) + log.Printf(fmt.Sprintf("passwd 162 : %v %v", err, ldapConn)) + log.Printf(fmt.Sprintf("passwd 163 : %v", user)) return err }