diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-09 19:56:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-09 19:56:01 +0100 |
commit | f929ca7297905e4233aa32fe2d80dd4cc3fcda30 (patch) | |
tree | 4cf59a71cef9c4126fda38cfa5735bcd8a693575 /profile.go | |
parent | 13222204392009e07382eecb908b7e6e01155ec4 (diff) | |
download | guichet-f929ca7297905e4233aa32fe2d80dd4cc3fcda30.tar.gz guichet-f929ca7297905e4233aa32fe2d80dd4cc3fcda30.zip |
Uniformize templates
Diffstat (limited to 'profile.go')
-rw-r--r-- | profile.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -63,10 +63,11 @@ func handleProfile(w http.ResponseWriter, r *http.Request) { } type PasswdTplData struct { - Status *LoginStatus - ErrorMessage string - NoMatchError bool - Success bool + Status *LoginStatus + ErrorMessage string + TooShortError bool + NoMatchError bool + Success bool } func handlePasswd(w http.ResponseWriter, r *http.Request) { @@ -89,7 +90,9 @@ func handlePasswd(w http.ResponseWriter, r *http.Request) { password := strings.Join(r.Form["password"], "") password2 := strings.Join(r.Form["password2"], "") - if password2 != password { + if len(password) < 8 { + data.TooShortError = true + } else if password2 != password { data.NoMatchError = true } else { modify_request := ldap.NewModifyRequest(login.Info.DN, nil) |