cambiarla es obligatorio

merge-requests/5/head
Kali Kaneko 4 years ago
parent 0f6d0732b9
commit 350d105fc5
  1. 5
      server/user.go
  2. 3
      tmpl/password.html

@ -60,10 +60,15 @@ func (s *server) passwordHandler(w http.ResponseWriter, r *http.Request) {
oldpass := r.FormValue("oldpass")
pass := r.FormValue("password")
pass2 := r.FormValue("password2")
if pass != pass2 {
response.execute("WrongPass")
return
}
if pass == oldpass {
response.execute("SameOldPass")
return
}
err := s.ldap.ChangePass(response.User, oldpass, pass)
if err != nil {

@ -19,7 +19,8 @@
</div>
<div class="form-group">
<label for="password">Nueva contraseña:</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Contraseña">
<input type="password" class="form-control {{if eq .Data "SameOldPass"}}is-invalid{{end}}" id="password" name="password" placeholder="Contraseña">
{{ if eq .Data "SameOldPass"}}<div class="invalid-feedback">Cuando dec&iacute;amos "cambiarla" nos refer&iacute;amos a... cambiarla ;)</div>{{end}}
</div>
<div class="form-group">
<label for="password2">Repite la contraseña nueva:</label>

Loading…
Cancel
Save