Commit Graph
17 Commits
Author SHA1 Message Date
David Goodwin 7dc14406f7 remove phpVersion attribute from psalm which caused it to fail to see newer style PHP code and incorrectly error 2026-03-31 06:18:55 +01:00
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 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 4d17aa6ef9 manaul merge in of verdigado:master (see #753) (MFA/TOTP support) 2023-12-23 17:05:52 +00:00
David Goodwin 1855513b57 remove smarty from psalm.xml 2022-09-17 10:55:17 +01:00
David Goodwin b2831d1241 psalm improvements 2021-02-17 21:29:18 +00:00
David Goodwin 4188aa3868 regenerate psalm config 2020-11-09 21:49:50 +00:00
David Goodwin 484acfbf59 Remove the random_compat lib. 2020-09-27 10:47:22 +01:00
David Goodwin 87824ef970 psalm fixes/workarounds; require PHP 5.6+ 2019-10-19 20:51:05 +01:00
David Goodwin 7965a83aff tighten psalm checks even more 2019-09-17 21:05:08 +01:00
David Goodwin 34e6f7829e tighten psalm checks; fix errors 2019-09-17 20:55:14 +01:00
David Goodwin 034a50836c tighten psalm checks 2019-09-17 20:50:42 +01:00
David Goodwin 7f8fd5ec1a Merge branch 'master' into feature-try-pdo 2019-01-16 09:23:29 +00:00
David Goodwin 83a4ee39b0 more phpdoc 2019-01-16 09:23:09 +00:00
David Goodwin 803e2342f8 fix psalm issues; reformat; rename new db functions 2019-01-06 21:32:58 +00:00
David Goodwin 19cda31849 remove psalm warnings from code; fix password_expiry behaviour when enabled/disabled on MySQL 2018-12-28 19:27:33 +00:00