W12 family names keep their accents, login made without them; W9 banner link colour; W10 recovery-code page one plain line; W11/W24 remote page hides provider login and key fields behind Haladó; unreleased
gates / gates (push) Successful in 1m33s

This commit is contained in:
admin committed 2026-10-21 22:35:24 +02:00
1 parent 37b79caad9
commit 8c1e290f63
33 files changed
+1278 -93

No files matched your search

+12 -4
View File
@@ -391,7 +391,9 @@ func (s *Server) ServeFamilyLogin(w http.ResponseWriter, r *http.Request) {
s.renderFamilyPage(w, r, rd, s.msg(r, "family_gate.msg.form_expired"), http.StatusForbidden)
return
}
name := strings.ToLower(strings.TrimSpace(r.FormValue("name")))
// W12: a member may type their name as the household wrote it („Ödön"); the login is made the same way the card
// made it. A login typed as shown („odon2") is unchanged by LoginFrom.
name := family.LoginFrom(r.FormValue("name"))
visitor := rateKey(r)
// R-983 (v0.324.0): the try is counted BEFORE the password is checked, in the same step as the lock check, so
// parallel tries cannot all pass a check none of them has counted yet. A right password clears both counts.
@@ -484,7 +486,7 @@ func (s *Server) familyMembersHandler(w http.ResponseWriter, r *http.Request) {
escrowJSON(w, http.StatusServiceUnavailable, nil, s.msg(r, "family_gate.msg.store_unreadable"))
return
}
escrowJSON(w, http.StatusOK, map[string]any{"members": st.Names()}, "")
escrowJSON(w, http.StatusOK, map[string]any{"members": st.Names(), "people": st.People()}, "")
}
// familyMemberActionHandler: POST /family/members/{add,reset,remove} with `name`. add/reset answer the new password
@@ -496,13 +498,19 @@ func (s *Server) familyMemberActionHandler(w http.ResponseWriter, r *http.Reques
return
}
_ = r.ParseForm()
// W12 (2026-10-21): „add" takes the name as the household typed it („Ödön") and answers the login made from it
// (odon); reset and remove name the LOGIN, which the card holds.
name := strings.ToLower(strings.TrimSpace(r.FormValue("name")))
w.Header().Set("Cache-Control", "no-store")
var pw string
var err error
switch action {
case "add":
pw, err = st.Add(name)
var login string
login, pw, err = st.AddPerson(r.FormValue("name"))
if err == nil {
name = login
}
case "reset":
pw, err = st.Reset(name)
case "remove":
@@ -527,7 +535,7 @@ func (s *Server) familyMemberActionHandler(w http.ResponseWriter, r *http.Reques
return
}
s.logger.Printf("[INFO] [web] family: the household's %s of %q from %s (password never logged)", action, name, clientIP(r))
out := map[string]any{"name": name, "members": st.Names()}
out := map[string]any{"name": name, "members": st.Names(), "people": st.People()}
if pw != "" {
out["password"] = pw
}