STW: add checkbox to subscribe to newsletter #1061
No Reviewers
Labels
Clear labels
Accessibility
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 labels
Milestone
No items
No Milestone
Assignees
albert (Albert Dengg)
alex.busch (alex.busch)
alex.sander (alex.sander)
anaghz (anaghz)
annarita.russo (annarita.russo)
ao (André Ockers)
bonnie (bonnie)
ciampix (Marco Ciampa)
cryptie (cryptie)
dario (dario)
delliott (Darragh Elliott)
dfajfer (Damian Fajfer)
dmaphy (Dominic Hopf)
doczkal (Thomas Doczkal)
eal (eal)
egnun (Erik Grun)
eventregbot (eventregbot)
fi (fi)
floriansnow (Florian Snow)
foxort (Tino Tempesta)
gabriel.ku (gabriel.ku)
guido (guido)
hf (hf)
hugo (hugo)
ineiev (ineiev)
jithendra (jithendra)
jn (jn)
jzarl (jzarl)
linus (Linus Sehn)
lucabon (Luca Bonissi)
lucas.lasota (lucas.lasota)
max.mehl (Max Mehl)
mk (Matthias Kirschner)
monochromec (monochromec)
mweimann (Michael Weimann)
nico.rikken (nico.rikken)
patrick (Patrick Ohnewein)
reinhard (Reinhard Müller)
renovate-bot (Renovate Bot)
repentinus (Heiki Lõhmus)
schiessle (Björn Schießle)
silviarbgl (Silvia Rbgl)
sofiaritz (Sofía Aritz)
tobiasd (tobiasd)
vincent (vincent)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: FSFE/fsfe-website#1061
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.
I've finally managed to let people ordering promo material subscribe to our newsletter. The problem was caused by Mailman's anti-bot measurements, and them accepting the generated CSRF token only after a few seconds.
Missing so far:
the script subscribes user to English newsletter only. We could make this depending on the used languageLanguage detection also working, at least from those pages which are actually translated.
Ready for review :)
I'm not allowed to push into your branch. Maybe next time open the PR in the fsfe-website repo.
Here is the promotion curl code without exec:
Depending on the PHP version on the server some options may differ. @max.mehl which version do we have there?
And here the suggestion for the second exec:
Simple golden rule: do not pass anything not under you control unescaped as exec param. Like the name parts coming from
$_POST.Thank you for the review!
I modified the curl request a bit because it takes quite some time to complete if the newsletter option is requested. So I set a very small timeout.
Regarding odtfill, $name and $address already have been escaped before, but I'll take your code because it is more clean.
Please feel free to review again :)
I crawled the PHP doc https://www.php.net/manual/en/function.exec.php and found
→ exec should work for background tasks
In the end it calls another PHP script in the same directory. So why curl anyway? :)
promotion.php
mail-signup.php
I somehow can't test that in my environment. Maybe we can work having that running in my docker setup when we meet next time :)
I like, thanks! That's a good approach, will try to implement it soon :)
Implemented. I guess it's fine for now. Will merge and test with the live system