Commit Graph
20 Commits
Author SHA1 Message Date
David Goodwin 8a1f9a11af CSRF protection - support multiple tokens (#985)
possible fix for https://github.com/postfixadmin/postfixadmin/issues/967

CSRF Token changes : rather than have one PFA_Token value in $_SESSION, store a list of them, where each value has a time stamp it was issued on. The aim is to allow the user to have multiple browser tabs open at once - and not have the last tab that loaded trample on others. Tokens expire after 1 hour.

Adds a Smarty helper function `{CSRF_Token}` which will output `<input type=hidden name=CSRF_Token value=asdf123>` or `{CSRF_Token type=url}` which outputs a literal string like 'asdf123' suitable for placing in a URL.

Adds a PHP exception handler in public/common.php, which could be used to display a more friendly error message/response (but at the moment is fairly minimal).

Removes most uses of `die()` within the codebase, and instead moves to throw an exception
2026-03-01 19:30:16 +00:00
David Goodwin cb91ae64f2 formatting 2026-02-28 16:41:45 +00:00
Fredrik Boström 902739f96d WIP: TOTP reset for lost secrets (#988)
add TOTP reset for lost secrets - see #924
2026-02-28 10:15:07 +00:00
David Goodwin dd24020de2 formatting 2026-01-28 09:50:26 +00:00
David Goodwin ff0a3d7636 psalm stuff, add Languages class, token refactor 2026-01-28 09:50:26 +00:00
David Goodwin 52794bede7 misc fixes for psalm after allowing it to be updated 2026-01-28 09:50:26 +00:00
David Goodwin 460c624275 remove more references to sourceforge 2025-07-13 18:29:37 +01:00
David Goodwin 759304ecb8 apparently these all need reformatting 2024-12-05 14:33:41 +00:00
David Goodwin 6cc7922284 see #642 - possible fix for pagination being lost 2022-07-25 09:44:12 +01:00
Unknown 029d749fb8 Redirect to listview after editing 2021-07-05 15:39:51 -03:00
David Goodwin 750838d7f7 psalm fixes; make safepost()/safeget() return strings 2020-11-09 21:40:52 +00:00
David Goodwin 8bfe9fe668 Rejig PFASmarty, so it becomes a singleton accessible to the various 'controllers'.
(PFASmarty::getInstance() ... stops a global variable at least).
2020-09-27 10:49:58 +01:00
David Goodwin d7fa33a3ed s/store/save/g 2020-09-25 21:43:34 +01:00
David Goodwin 8754af58cb fix undefined variables (psalm) 2020-03-12 20:45:51 +00:00
David Goodwin bcae218cbb composer format time 2019-10-19 21:36:27 +01:00
David Goodwin b8d7c0513f psalm fix 2019-10-17 20:03:47 +01:00
David Goodwin 95429a6963 reindent, remove comment 2019-06-08 20:05:59 +01:00
Christian Boltz d2588a4de2 Fix phpcs whitespace breakage in initStruct etc. 2018-04-22 18:24:41 +02:00
Adrien Crivelli 15df6c1d7b Reformat everything with PHP-Cs-Fixer 2018-01-26 23:54:37 +09:00
David Goodwin 99147d51eb move public facing stuff into public/, this allows us to stop exposing templates_c/ etc to the world 2018-01-25 20:27:09 +00:00