]> git.ipfire.org Git - thirdparty/cups.git/commit
cgi: Fix checkbox support (fixes #1008) 1010/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 22 Jul 2024 10:32:32 +0000 (12:32 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 22 Jul 2024 10:32:32 +0000 (12:32 +0200)
commitf37d3eb8a091addda1b34d6d264e8a4ac25cec25
tree6dbe117600470ab7f21d4d77e33bb5baf87b251a
parent3b564fd99157d5a31fcf5ce6a8fa14be4dda5d6c
cgi: Fix checkbox support (fixes #1008)

There was a change in CGI script regarding checkboxes, however it did
not propagate into templates. Based on the change, the only valid check
was if the variable value was checkbox, but some browsers (at least
Firefox) send on as a default value for input form of type checkbox.

Additionally, the value checkbox looks like typo, because we use checked
as value for checkboxes in admin CGI program, so I updated
cgiGetCheckbox() as well.

To fix the behavior, we have to set VALUE="CHECKED" into every tag in
every templates for all checkboxes - this value will be sent in the
input form, so it will properly match with cgiGetCheckbox() logic now.

In the end, I have found out "Preserve Job History" checkbox from
template was handled as text field, which did not look correct.

Fixes #1008
29 files changed:
cgi-bin/admin.c
cgi-bin/var.c
templates/add-printer.tmpl
templates/admin.tmpl
templates/da/add-printer.tmpl
templates/da/admin.tmpl
templates/da/modify-printer.tmpl
templates/de/add-printer.tmpl
templates/de/admin.tmpl
templates/de/modify-printer.tmpl
templates/es/add-printer.tmpl
templates/es/admin.tmpl
templates/es/modify-printer.tmpl
templates/fr/add-printer.tmpl
templates/fr/admin.tmpl
templates/fr/modify-printer.tmpl
templates/ja/add-printer.tmpl
templates/ja/admin.tmpl
templates/ja/modify-printer.tmpl
templates/modify-printer.tmpl
templates/pl/add-printer.tmpl
templates/pl/admin.tmpl
templates/pl/modify-printer.tmpl
templates/pt_BR/add-printer.tmpl
templates/pt_BR/admin.tmpl
templates/pt_BR/modify-printer.tmpl
templates/ru/add-printer.tmpl
templates/ru/admin.tmpl
templates/ru/modify-printer.tmpl