Mail review stage 7a: mail passwords, the OAuth client secret and the mail tokens are stored encrypted with a key from config.php's backup key, kept as typed only when there is no key, with a warning in Admin > Settings > Mail when they can't be read (database 4.3.1); pictures from other sites in client email are held back on a ticket, its quick look and its work order until Show pictures is clicked; the sign-in page no longer loads the mail server's password; 26.12.3 changelog

This commit is contained in:
johnnyq
2026-11-30 21:34:43 -05:00
parent 6cec0b8574
commit b3ba5d7275
21 changed files with 339 additions and 65 deletions

View File

@@ -0,0 +1,26 @@
<?php
/*
* ITFlow - Database update to version 4.3.1 (from 4.3.0)
* Included by admin/database_updates.php - do not access directly
*
* The mail passwords, OAuth secret and tokens are encrypted (functions/mail_secret.php): the password and secret
* columns made wide enough for an encrypted value, then those saved as typed encrypted - when config.php has a
* backup key, or one can be added to it. Without one they stay as they are, and the nightly job tries again.
*
* Re-runnable: a column is widened only while it is narrower, and a value is encrypted only once.
*/
defined('FROM_DB_UPDATER') || die("Direct file access is not allowed");
foreach (['config_smtp_password', 'config_imap_password', 'config_mail_oauth_client_secret'] as $itflow_column) {
$itflow_width = mysqli_fetch_row(mysqli_query($mysqli, "SELECT CHARACTER_MAXIMUM_LENGTH FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'settings' AND COLUMN_NAME = '$itflow_column' LIMIT 1"));
if ($itflow_width && intval($itflow_width[0]) < 500) {
mysqli_query($mysqli, "ALTER TABLE `settings` MODIFY `$itflow_column` varchar(500) DEFAULT NULL");
}
}
if (function_exists('mailSecretsSealAll')) {
mailSecretsSealAll(true);
}