Mail review stage 7d: the links in emails that open a ticket, invoice or quote without signing in stop working a set time after it is closed, paid or answered, 90 days to start and set in Admin > Settings > Security, with an expired page pointing to the client portal and Copy Client Link marked Expired; your own subject, heading, opening and closing text for the 13 emails about a ticket to clients, edited from Admin > Settings > Mail > Previews with square-bracket placeholders (database 4.3.4); 26.12.3 changelog

This commit is contained in:
johnnyq
2026-11-30 21:36:58 -05:00
parent 20b2d1883e
commit 812c4ae9c2
20 changed files with 709 additions and 25 deletions

View File

@@ -4,8 +4,9 @@
* Admin > Settings > Security (admin/settings_security.php):
* edit_security_settings saves the sign-in page's message and login key, how
* long a browser is remembered, whether passkeys sign people in, when admins
* hear of failed sign-ins, whether the API takes a key in the address, and
* shared links. A login key required with none set - which would leave
* hear of failed sign-ins, whether the API takes a key in the address,
* shared links, and how long the links in emails work once a ticket, invoice
* or quote is done. A login key required with none set - which would leave
* agents no way in but the database - is refused, as is a key that couldn't
* be typed into an address, or a time out of range. Nothing is saved then.
* A choice not offered settles to the usual one.
@@ -20,7 +21,9 @@ if (isset($_POST['edit_security_settings'])) {
$before = settingsCurrent(array_merge(['config_login_message', 'config_login_key_required', 'config_login_key_secret', 'config_login_remember_me_expire',
'config_login_alert_failures', 'config_api_key_in_address', 'config_share_max_hours', 'config_share_require_protection'],
// Passkeys, once the database has them (functions/passkey.php)
passkeysReady() ? ['config_login_passkeys'] : []));
passkeysReady() ? ['config_login_passkeys'] : [],
// How long a done ticket's, invoice's or quote's link works (functions/guest_link.php)
guestLinkReady() ? ['config_guest_link_days'] : []));
// What was sent, and what is saved for anything that wasn't - a switch not sent is off
$in = $_POST + array_map(function ($value) { return (string) $value; }, $before);
@@ -38,6 +41,9 @@ if (isset($_POST['edit_security_settings'])) {
if (array_key_exists('config_login_passkeys', $before)) {
$after['config_login_passkeys'] = empty($_POST['config_login_passkeys']) ? 0 : 1;
}
if (array_key_exists('config_guest_link_days', $before)) {
$after['config_guest_link_days'] = intval($in['config_guest_link_days']);
}
$errors = [];
if ($after['config_login_key_secret'] !== '' && !preg_match('/^\w{3,99}$/', $after['config_login_key_secret'])) {
@@ -56,6 +62,9 @@ if (isset($_POST['edit_security_settings'])) {
if (!isset(shareMaxOptions()[$after['config_share_max_hours']])) {
$after['config_share_max_hours'] = 720;
}
if (isset($after['config_guest_link_days']) && !isset(GUEST_LINK_DAYS_CHOICES[$after['config_guest_link_days']])) {
$after['config_guest_link_days'] = GUEST_LINK_DAYS_DEFAULT;
}
if ($errors) {
settingsRefuse('security', $errors);
}