28 Commits
Author SHA1 Message Date
Rodrigo Cortés Cano 314a3242c9 Escape viewlog output by default (#1134)
Render log records through the default output sanitization path and
remove the inline JavaScript interpolation of log data.

Full log data remains available through a native details element without
placing it in a script context.

Refs #1128

thanks @TrapoSAMA
2026-08-29 14:51:41 +01:00
Kent Riboe 00622a1155 Add reusable _pagination.tpl partial, use it in viewlog (#1064) (#1090)
adds templates/_pagination.tpl - bootstrap 5 shared pagination component. 
migrates viewlog to use it.

See  #1064 (thanks @TrapoSAMA and @Knofte)
2026-07-27 19:14:24 +01:00
Kent Riboe 0f68dee15c viewlog: per-page selector + Bootstrap 5 pager, fix footer layout (#1062) (#1063)
Improve pagination on viewlog page (make page size configurable, use bootstrap 5 pager) 

Closes #1062. Thanks @knofte
2026-07-05 20:21:19 +01:00
Kent Riboe d6aabd7745 viewlog: add "All domains" option to the log viewer (#1059) (#1060)
Adds an **"All domains"** option to the View Log domain dropdown, so an
admin managing many domains can see log entries across all of them in
one view instead of picking each domain individually.

Closes #1059.

Thanks @knofte
2026-07-01 16:22:21 +01:00
Kent Riboe 26530c5d0b Replace escape_string() concatenation with parameterized queries (#1004)
* Replace most escape_string() usages with parameterized queries (reducing the chance of SQL injection), see also #1003 

thanks @knofte
2026-04-06 20:47:34 +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 90d407b5fe token renames (a variable called SESSID_USERNAME makes me think it is reserved by PHP or something, which I do not think it actually is, so just user a more meaningful $username 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 f01274ec94 try relaxing composer dependencies to allow php8.2 dev support, reformat so composer format passes 2024-04-22 21:02:01 +01:00
David Goodwin 2d6ded2786 PSR2 -> PSR12 formatting 2022-06-28 13:46:11 +01:00
David Goodwin fa9a9f36d1 reformat 2022-01-12 11:27:50 +00:00
benchea dan ec6e974f10 Update viewlog.php 2022-01-12 11:54:18 +02:00
benchea dan 985273d07a Update viewlog.php 2022-01-12 11:44:55 +02:00
benchea dan d80041bf4e Update viewlog.php 2022-01-12 10:39:16 +02:00
benchea dan 8690f1c2b6 Update viewlog.php 2022-01-12 10:37:29 +02:00
David Goodwin 0b07b052fc fix formatting! 2021-07-17 10:33:08 +01:00
David Goodwin 6d00833c75 probable fix for https://github.com/postfixadmin/postfixadmin/issues/516 - admins can see all domains so no fDomain parameter etc 2021-07-17 10:31:06 +01:00
Unknown 5faa292cfb Allow super admins to view all logs 2021-07-05 17:13:37 -03:00
David Goodwin f6f62180e8 remove some global variables 2020-09-27 11:02:58 +01:00
David Goodwin 803e2342f8 fix psalm issues; reformat; rename new db functions 2019-01-06 21:32:58 +00:00
David Goodwin 1176c9ce78 reformat; fix some transition bugs 2019-01-06 21:32:58 +00:00
David Goodwin ea33d9951a try migrating to pdo 2019-01-06 21:32:58 +00:00
David Goodwin 4fcdba9cf4 run php-cs-fixer (code reforamt) 2018-12-28 19:31:43 +00:00
David Goodwin 74002bbf57 psalm fixes 2018-12-27 21:43:11 +00:00
David Goodwin c147eb053b move to use db_assoc() rather than db_array() (code assumes assoc. array) 2018-02-10 21:08:29 +00: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