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

@@ -85,14 +85,12 @@ $refresh_token = (string) $json['refresh_token'];
$access_token = (string) $json['access_token'];
$expires_at = date('Y-m-d H:i:s', time() + intval($json['expires_in'] ?? 3600));
$refresh_token_esc = mysqli_real_escape_string($mysqli, $refresh_token);
$access_token_esc = mysqli_real_escape_string($mysqli, $access_token);
$expires_at_esc = mysqli_real_escape_string($mysqli, $expires_at);
// Only the token - Sending and Receiving stay as they were set; connecting for one doesn't turn on the other
// Only the token - Sending and Receiving stay as they were set; connecting for one doesn't turn on the other. Sealed (functions/mail_secret.php)
mysqli_query($mysqli, "UPDATE settings SET
config_mail_oauth_refresh_token = '$refresh_token_esc',
config_mail_oauth_access_token = '$access_token_esc',
" . mailSecretSql('config_mail_oauth_refresh_token', $refresh_token) . ",
" . mailSecretSql('config_mail_oauth_access_token', $access_token) . ",
config_mail_oauth_access_token_expires_at = '$expires_at_esc'
WHERE company_id = 1
");