diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-19 10:35:14 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-19 10:35:14 +0200 |
commit | 3c846b6a59c1e725b56b7784c30cfbd5a3dc080b (patch) | |
tree | c5c3353f3b5332e0477a3a376192d206d6e79faf /profile.go | |
parent | 216e175eafd50b977e132ca0055df9fed9e83a6a (diff) | |
download | guichet-3c846b6a59c1e725b56b7784c30cfbd5a3dc080b.tar.gz guichet-3c846b6a59c1e725b56b7784c30cfbd5a3dc080b.zip |
Inclusive + Fix checks + Fix SSHAbetter_login
Diffstat (limited to 'profile.go')
-rw-r--r-- | profile.go | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -122,12 +122,17 @@ func handlePasswd(w http.ResponseWriter, r *http.Request) { data.NoMatchError = true } else { modify_request := ldap.NewModifyRequest(login.Info.DN, nil) - modify_request.Replace("userpassword", []string{SSHAEncode([]byte(password))}) - err := login.conn.Modify(modify_request) - if err != nil { - data.ErrorMessage = err.Error() + pw, err := SSHAEncode(password); + if err == nil { + modify_request.Replace("userpassword", []string{pw}) + err := login.conn.Modify(modify_request) + if err != nil { + data.ErrorMessage = err.Error() + } else { + data.Success = true + } } else { - data.Success = true + data.ErrorMessage = err.Error() } } } |