aboutsummaryrefslogtreecommitdiff
path: root/profile.go
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 10:35:14 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 10:35:14 +0200
commit3c846b6a59c1e725b56b7784c30cfbd5a3dc080b (patch)
treec5c3353f3b5332e0477a3a376192d206d6e79faf /profile.go
parent216e175eafd50b977e132ca0055df9fed9e83a6a (diff)
downloadguichet-3c846b6a59c1e725b56b7784c30cfbd5a3dc080b.tar.gz
guichet-3c846b6a59c1e725b56b7784c30cfbd5a3dc080b.zip
Inclusive + Fix checks + Fix SSHAbetter_login
Diffstat (limited to 'profile.go')
-rw-r--r--profile.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/profile.go b/profile.go
index 4f5cf28..603b10a 100644
--- a/profile.go
+++ b/profile.go
@@ -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()
}
}
}