This PR includes two small UI improvements:
* Add horizontal scroll wrappers to virtual mailbox/alias lists so
action buttons and table content do not overflow narrow desktop/tablet
widths.
* Add a domain quota tooltip showing assigned quota and real used quota,
while preserving the existing visible assigned quota text and
usage-based bar color.
Tested locally with PHP lint for DomainHandler.php.
thanks @trapoSAMA
various patches from @trapoSama sent via email -
* Keeps the assigned domain quota text and uses real mailbox usage for
the quota bar color and fill.
* Shows a red count next to a domain when one or more mailboxes exceed
the configured quota alert threshold. Requires patch 1.
* Adds optional configuration to hide mailbox quota and password expiry
columns while retaining those values in the domain tooltip.
* Corrects the quota-bar markup and aligns domain-list columns.
* Replaces the quota bars in the domain overview and mailbox list with a
unified bar component, preventing the fill, label, and border from
separating. It hides Modified, Backup MX, and Transport progressively on
reduced desktop widths, then uses horizontal scrolling as the final
fallback.
* Uses icon-only controls with translated tooltips in domain and mailbox
lists: active state, SMTP active state, autoresponder, alias, edit, and
delete. Active-state tooltips show the current value, for example
`Activo: SI` or `Activo: NO`.
- Use context-specific top menu labels instead of reusing the first dropdown
item label.
- Compact the Bootstrap 5 top navbar spacing and switch collapse to xl to avoid wrapping on desktop widths.
- Move hardcoded main dashboard/search labels into PALANG entries, including Spanish
translations
thanks @TrapoSAMA
Adds a `description` field to the `alias` and `alias_domain` tables, so you can add a comment explaining why the alias exists.
Partially addresses #1036
thanks @jpwarren
Implements the improvements suggested by @fredkilbourn in #1024, cleaned up for current master.
**Changes:**
1. **Auto-generate RSA 2048 keypair** when creating a new DKIM key. Only
generates on the create form, not on list views or edits.
2. **Descriptive signing table dropdown** shows `domain:selector
(description) [id]` instead of just the numeric ID.
3. **Domain:Selector and Description columns** in the signing table list
view via LEFT JOIN.
4. **Order by domain:selector** instead of raw dkim_id.
**Technical notes:**
- Uses `$this->new` check to avoid key generation overhead on list/edit
views
- Handles MySQL (`CONCAT()`) vs SQLite/PostgreSQL (`||`) string
concatenation
- Uses named arguments for `pacol()` per current conventions
Two separate commits. Credit to @fredkilbourn for the original patch.
- Make cards look closer to Bootstrap reference implementation by
removing padding and using the proper header element.
- Vertically center align table row content.
- Add a theme adaptive background to the navigation bar, and reuse the
design for non logged in pages.
thanks @Lombra
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