Commit Graph
3442 Commits
Author SHA1 Message Date
Rodrigo Cortés Cano 730ddcb909 Improve virtual list responsiveness and quota tooltip (#1050)
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
2026-06-28 08:49:53 +01:00
David Goodwin 74c50fb12b update CHANGELOG.TXT 2026-06-27 16:31:22 +01:00
David Goodwin ff73976b72 UI enhancements around quota and icons for domain/mailbox lists
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`.
2026-06-27 16:22:33 +01:00
Rodrigo Cortés Cano e0067e4138 Improve top menu and main dashboard labels (#1047)
- 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
2026-06-26 08:54:08 +01:00
David Goodwin 30be899218 remove extra "D" from es.lang (thanks @trapoSama, see https://github.com/postfixadmin/postfixadmin/discussions/1039) 2026-06-14 09:56:18 +01:00
David Goodwin a83dc2f20e update spanish translation, thank you @trapoSAMA - see https://github.com/postfixadmin/postfixadmin/discussions/1039 2026-06-12 21:24:45 +01:00
David Goodwin 710e1acce9 update CHANGELOG.TXT 2026-06-08 09:15:20 +01:00
Justin Warren 2469e045d8 Add 'description' field to alias and alias_domain tables. (#1042)
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
2026-06-08 09:08:02 +01:00
Justin Warren 08cf7a8e6e Improve native (.deb) packaging for Debian/Ubuntu 24.04 (#1041)
thanks @jpwarren
2026-06-08 09:06:44 +01:00
David Goodwin 8696f300c5 formatting 2026-05-23 15:10:25 +01:00
Kent Riboe 650a91bd05 Improve DKIM: auto-generate keypair, descriptive signing table (#1029)
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.
2026-05-23 14:41:13 +01:00
Fredrik Boström 1024befd39 Fix pw recovery without totp (#1032)
Check if user has TOTP active, if so display input field in pw-change form and evaluate it.
2026-05-23 14:34:42 +01:00
Lombra f77f079d37 Update appearance for consistency (#1030)
- 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
2026-05-09 09:32:24 +01:00
Copilot ae7339afd4 Use native booleans for prepared SQL params; stop binding db_get_boolean() values (#1019)
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
2026-04-23 19:28:01 +01:00
Kent Riboe 2cce49a657 Add tests for db_where_clause() and db_delete() with additional params (#1021)
Adds test coverage for the core query-building functions refactored in #1004:
 - db_where_clause()
 - db_delete()
2026-04-22 13:41:47 +01:00
David Goodwin b420341083 let down by formatting again :( 2026-04-21 09:17:57 +01:00
David Goodwin a762682d7c token test of PFAHandler::col() and 9th param rename from $options to $not_in_db 2026-04-21 09:15:20 +01:00
David Goodwin ca4dae3ffe Phpunit updates (fix phpunit run, should fix build) (#1016)
should fix build, which is currently failing due to a stale phpunit config and poor choice of class name
2026-04-18 10:42:02 +01:00
Kent Riboe c6773f8390 Migrate TOTP exceptions to TotpexceptionHandler class (#1007)
refactor code to use the PFAHandler approach, allowing re-use of list.php and edit.php.
2026-04-18 10:22:54 +01:00
Kent Riboe 8e6a4f0f4b Add developer documentation for Handler classes, update PFAHandler::pacol() params (#1008)
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.
2026-04-18 10:10:00 +01:00
Kent Riboe 2c0a06f932 Add Exec class to help refactor/reduce duplication of proc_open calls, update phpunit (see note) (#1009)
* 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
2026-04-18 10:05:35 +01:00
Kent Riboe c376b56029 Add regression tests for global admin TOTP exception privileges (#1015)
* 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
2026-04-15 21:12:01 +01:00
Kent Riboe e546e6d593 Fix privilege check ordering for TotpPf::addException (global admin being treated like admin) (#1012)
* 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.
2026-04-14 21:17:03 +01:00
Kent Riboe 0f9f67be0f Add missing database indexes for domain_admins and fetchmail (#1010)
* 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.
2026-04-09 09:24:57 +01:00
David Goodwin cdc0084348 add token changelog entries for "master" before we get to out of sync and start forgetting things 2026-04-06 20:56:33 +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
Kent Riboe 0b462e227a Add version check page with changelog for global admins (#1006)
* 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)
2026-04-06 20:44:11 +01:00
David Goodwin f88236bf66 fix unit tests - handle booleans in postgresql being different from mysql etc 2026-04-06 20:29:16 +01:00
Kent Riboe 291609ae6f Add phpstan, MySQL and PostgreSQL test jobs to CI (#1005)
* Add phpstan for static analysis.
* Run unit tests against MySQL and PostgreSQL databases

Thanks @knofte
2026-04-06 09:01:44 +01:00
David Goodwin f20d12c16c use db specific boolean in sql (TotpPfTest) 2026-04-03 09:55:49 +01:00
Kent Riboe 225a55d5d9 Add GitHub Actions workflow to build self-contained release archives (#999)
* 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
2026-04-03 09:42:18 +01:00
David Goodwin fa3bac8196 drop postfixadmin.my.cnf - not necessary 2026-04-03 09:38:37 +01:00
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
Kent Riboe ae96481c99 Remove old Bootstrap 3 remnants (dark-theme.css, col-sm-offset in setup.php) (#1002) 2026-03-31 06:17:54 +01:00
David Goodwin 489c9aacb6 fix xmlrpc.php -> setAway - parameter types changed after this file was deleted 2026-03-29 11:56:33 +01:00
David Goodwin 1223197a7e formatting... 2026-03-29 11:48:05 +01:00
wvolz c4a276f26d Disable totp and app password pages based on settings (#996)
- Redirect to main.php if totp ($CONF['totp']) or app password page ($CONF['app_passwords']) is accessed and the config is disabled.
2026-03-27 09:34:18 +00:00
wvolz 874d01b10b hide app_passwords menu items if disabled in config (#995) 2026-03-26 09:30:02 +00:00
David Goodwin 522ba1a772 add back xmlrpc.php - it seems it is in use - see #993 2026-03-24 14:06:08 +00:00
David Goodwin 57378ee157 see #992 - try and remove bash-ism from postfixadmin-cli wrapper; manual merge of provided patch 2026-03-24 12:24:21 +00:00
David Goodwin 29a7c846f1 see #989 - allow newer version of spomky-labs/otphp, which removes some unnecessary dependencies and silences some PHP 8.4 warnings 2026-03-11 09:27:03 +00:00
David Goodwin 2ede2c8726 comments 2026-03-11 09:13:38 +00: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 7714aa47a3 always show the mailbox header in the list-virtual page, add title to domain aliases 2026-02-28 20:12:57 +00:00
David Goodwin d2de9bd896 fix csrf tag 2026-02-28 19:21:40 +00:00
David Goodwin 878d5ab3ef move dark mode toggle to the footer, remove {strip}, fix tag mismatch in menu etc 2026-02-28 19:16:42 +00:00
David Goodwin a53520ed35 main.tpl : translate some of the global search things 2026-02-28 19:15:45 +00:00
David Goodwin 5116a19046 add token padding to login form to perhaps make it look better 2026-02-28 19:15:19 +00:00
David Goodwin 80379c60c2 list.tpl - make table striped, add token padding, have only one <thead> section in a table 2026-02-28 19:12:30 +00:00
David Goodwin 18d13c2b1d fix mismatching </div> tags in list.tpl so it can be nicely indented again 2026-02-28 19:11:51 +00:00