Prepared statements were binding DB-specific boolean literals (`'t'/'f'`) produced by `db_get_boolean()`, which breaks PostgreSQL parameter typing in some paths (notably mailbox creation via handler flows).
This change standardizes bound boolean parameters to native PHP `true`/`false` (which are then cast to 0/1 which seems to work fine within PDO/PostgreSQL).
fixes https://github.com/postfixadmin/postfixadmin/issues/1017
Add DOCUMENTS/HANDLER_CLASSES.md which attempts to document how the Handler classes work and help future developers/contributors.
Changes spec of PFAHandler::pacol() to discourage the 9th parameter (was: multiopt) from being passed as an array (param renamed to not_in_db). Previous behaviour is maintained, but a deprecation error should be triggered.
* code refactoring (adds Exec class to centralise proc_open like calls).
* bump phpunit to ^11.0, as this is the last release that supports php8.2. Note, there is not (yet?) a phpunit release for php8.2 that fixes PKSA-z3gr-8qht-p93v or PKSA-5jz8-6tcw-pbk4, so ignore them for now in composer.json
* Add regression tests for global admin privilege check in TOTP exceptions (#1012)
Verifies that global admins with both 'admin' and 'global-admin' roles
can add TOTP exceptions for any domain, while regular admins are
restricted to their managed domains.
* Add tests for db_in_clause(): placeholders, empty array, unique keys, real query
Covers the parameterized query refactor from PR #1004.
* Move test cleanup to tearDown: add admin table delete and session unset
Prevents state leaking between tests, especially when expectException()
aborts the method before inline cleanup runs.
* Use assertEquals with exact expected SQL per review
* Fix privilege check ordering in TotpPf::addException() (#1012)
Global admins were incorrectly downgraded to regular admins because
authentication_has_role('admin') was checked before 'global-admin',
and global admins have both roles. Reorder to check global-admin first.
* Add missing isset() check on $_GET['abort'] in users/login-mfa.php (#1013)
Matches the admin version at public/login-mfa.php which already has
the isset() check.
* Add missing database indexes for domain_admins and fetchmail (see #972)
Adds composite index on domain_admins(username, domain, active) for
permission checks that run on every admin operation, and index on
fetchmail(mailbox) for domain deletion cascades.
* Add version check page with changelog for global admins (queries the github releases API etc).
* Updates language files to include new strings (actual translations not included, XXX place holders)
* Add GitHub Actions workflow to build self-contained release archives (#973)
Automatically builds a .tar.gz with vendor/ included when a release is published, this saves users from needing to use composer etc. Currently a single file, built for a PHP 8.2 environment.
Thanks @knofte
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
* Upgrade to Bootstrap 5.3.0 with Bootstrap Icons
* token improvements to setup.php rendering
* improve backup page rendering
* move to use html5 datetime-local field for vacation from/to rather than the previous js version
* remove datetimepicker js and bootstrap js and jquery (no longer needed)
* vacation: we load any previous dates in from the database, these could include ancient dates, so default them to now and now+1 if they are before today
* drop bootstrap 3.4.1 css
* bootstrap - add light mode / dark mode switch - taken from https://github.com/404GamerNotFound/bootstrap-5.3-dark-mode-light-mode-switch