Fixed Change Password Bug
This commit is contained in:
parent
947d0328b7
commit
1e44165fad
2 changed files with 5 additions and 3 deletions
|
@ -96,17 +96,17 @@ func handleLostPassword(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
ldapConn, err := openNewUserLdap(config)
|
ldapConn, err := openNewUserLdap(config)
|
||||||
if err != nil {
|
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()
|
data.ErrorMessage = err.Error()
|
||||||
}
|
}
|
||||||
err = passwordLost(user, config, ldapConn)
|
err = passwordLost(user, config, ldapConn)
|
||||||
if err != nil {
|
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()
|
data.ErrorMessage = err.Error()
|
||||||
} else {
|
} else {
|
||||||
err = ldapConn.Bind(config.NewUserDN, config.NewUserPassword)
|
err = ldapConn.Bind(config.NewUserDN, config.NewUserPassword)
|
||||||
if err != nil {
|
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()
|
data.ErrorMessage = err.Error()
|
||||||
} else {
|
} else {
|
||||||
data.Success = true
|
data.Success = true
|
||||||
|
|
|
@ -159,6 +159,8 @@ func modify(user User, config *ConfigFile, ldapConn *ldap.Conn) error {
|
||||||
func passwd(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)
|
passwordModifyRequest := ldap.NewPasswordModifyRequest(user.DN, "", user.Password)
|
||||||
_, err := ldapConn.PasswordModify(passwordModifyRequest)
|
_, err := ldapConn.PasswordModify(passwordModifyRequest)
|
||||||
|
log.Printf(fmt.Sprintf("passwd 162 : %v %v", err, ldapConn))
|
||||||
|
log.Printf(fmt.Sprintf("passwd 163 : %v", user))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue