order: Look up prices on the server, not in the POST request. #2750
Closed
rekado
wants to merge 2 commits from
rekado/fsfe-website:catalogue into master
pull from: rekado/fsfe-website:catalogue
merge into: FSFE:master
FSFE:master
FSFE:renovate/debian-13.x
FSFE:ilfs_ffm
FSFE:ADD-event-20261015-01-01-c520d656db22f2e1
FSFE:ADD-event-20260512-01-01-07e51c403fc908d6
FSFE:ADD-event-20260425-01-01-ad3dbaaecf1299d4
FSFE:20260312-nl
FSFE:ADD-event-20260326-01-01-2589dcc91daf0217
FSFE:ADD-event-20260312-02-01-c7adbbe3b20265e0
FSFE:newsletter-20260310-ES
FSFE:test
FSFE:feat/fedi-redirect
FSFE:ilovefs-report-update-redirect
FSFE:news-20260302-ada
FSFE:20260226-press
FSFE:fix/restore-timeline
FSFE:feat/sounds
FSFE:feat/langs
FSFE:feat/alpine
FSFE:ilovefs-update-resources
FSFE:add_article_to_fsfe
FSFE:ADD-event-20260214-02-01-0da443f5c183c1e1
FSFE:ADD-event-20260225-01-01-75a9dcab7e2a99d2
FSFE:ADD-event-20260221-01-01-5d760d92c0c2e9d4
FSFE:ADD-event-20260214-01-01-4c8b39667c7734bf
FSFE:fix-broken-links
FSFE:renovate/docker-29.x
FSFE:refactor-booth-application
FSFE:news-20250922-dma
FSFE:ilfs_typo
FSFE:followup-default-mail
FSFE:feature/peertube-for-upcycle-android
No Reviewers
Labels
Clear labels
bug
build
cgi Scripting
design
disruptive
documentation
duplicate
easy
enhancement
feature-request
help wanted
javascript
priority/low
question
system-hackers
tagging
text
translations
wait/bugfix
wait/inprogress
wait/misc
wait/proofread
wontfix
xsl
Requires careful coordination and documentation changes
Improving what is already there
No Label
Milestone
No items
No Milestone
Assignees
albert
alex.busch
alex.sander
anaghz
annarita.russo
ao
bcludts
bonnie
cryptie
dario
delliott
dfajfer
dmaphy
doczkal
eal
egnun
eventregbot
fi
floriansnow
gabriel.ku
guido
hugo
ineiev
jn
jzarl
linus
lucabon
lucas.lasota
max.mehl
mk
monochromec
mweimann
nico.rikken
patrick
reinhard
renovate-bot
repentinus
schiessle
sofiaritz
tobiasd
vincent
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: FSFE/fsfe-website#2750
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "rekado/fsfe-website:catalogue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The web shop form currently submits not only the amount of selected items to
cgi-bin/weborder.plin a POST request, but also submits the price.weborder.pltrusts these prices and uses them to compute the total.These two commits change this by generating a catalogue.xml containing the prices of all items. weborder.pl then looks up prices in that server-side file instead of accepting arbitrary prices in the user-supplied POST request, thereby guaranteeing that the prices have not been tampered with.
One more thing of note: catalogue.xml does not require any translations as it is not intended for presentation on the website. It could just as well be replaced with a database, but I wanted to keep the number of changes to a minimum.
The change looks good to me.
We could consider merging all the item.en.xml into a single file (the contents are not translated so we don't gain anything from having separate files per year), which AFAIU save us the additional step of creating the
catalogue.xmlfile and make things much more straightforward and understandable.I'm glad you suggest merging all the item files! I was taken aback by the complexity of processing the items when I considered implementing changes to the order form.
Having all items in the same XML file would simplify processing and unlock further improvements.
While we're at it, could we also merge all the
info.*.xmlfiles (one per language)? Or is there a reason why the year must be encoded in the directory name instead of, say, an XML attribute?The
info.*.xmlfiles are a different topic, since they are translated: ideally there we would have a separate file per item, so if the text for a given item is not translated, the fallback to the English text works automatically, and missing translations can easily be found.So we'd end up with something like:
This obviously requires quite a number of changes, but in the end the result was quite logical, understandable and maintainable.
What do you think?
@rekado Thank you very much for your work on this. I was wondering if theire are any blockers. If yes please let us know and we would do our best to help with them.
@reinhard is there anything I could do to help with this PR?
Completed in #4258, closing
Pull request closed