aboutsummaryrefslogtreecommitdiff
path: root/profile.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-09 19:56:01 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-09 19:56:01 +0100
commitf929ca7297905e4233aa32fe2d80dd4cc3fcda30 (patch)
tree4cf59a71cef9c4126fda38cfa5735bcd8a693575 /profile.go
parent13222204392009e07382eecb908b7e6e01155ec4 (diff)
downloadguichet-f929ca7297905e4233aa32fe2d80dd4cc3fcda30.tar.gz
guichet-f929ca7297905e4233aa32fe2d80dd4cc3fcda30.zip
Uniformize templates
Diffstat (limited to 'profile.go')
-rw-r--r--profile.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/profile.go b/profile.go
index 00e93dd..fa372bc 100644
--- a/profile.go
+++ b/profile.go
@@ -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)