mirror of
https://github.com/itflow-org/itflow
synced 2026-12-05 10:39:00 +00:00
Settings stage 4: Mail's Sending, Receiving, OAuth and From addresses tabs moved into the settings frame with provider-driven fields, refusals shown beside each field on the same tab and changes logged from old to new; passwords, the OAuth client secret and refresh token are no longer written into the page and are saved exactly as typed; a changed OAuth app or refresh token clears the cached access token, the access token field is removed and Microsoft 365 requires the tenant ID; the Microsoft connect callback stores only the tokens instead of switching both Sending and Receiving to Microsoft 365; Enter saves on the OAuth tab and on Logs; From addresses that are not email addresses are refused and From names keep their punctuation; removed the broken custom fields page with its handler and modals, the unused AI and online payment settings handlers, and the client autopay page
This commit is contained in:
@@ -89,15 +89,14 @@ $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
|
||||
mysqli_query($mysqli, "UPDATE settings SET
|
||||
config_imap_provider = 'microsoft_oauth',
|
||||
config_smtp_provider = 'microsoft_oauth',
|
||||
config_mail_oauth_refresh_token = '$refresh_token_esc',
|
||||
config_mail_oauth_access_token = '$access_token_esc',
|
||||
config_mail_oauth_access_token_expires_at = '$expires_at_esc'
|
||||
WHERE company_id = 1
|
||||
");
|
||||
|
||||
logAudit("Settings", "Edit", "$session_name completed Microsoft OAuth connect flow for mail settings");
|
||||
flashAlert("Microsoft OAuth connected successfully. Token expires at $expires_at.");
|
||||
logAudit("Settings", "Edit", "$session_name connected Microsoft 365 for mail");
|
||||
flashAlert("Microsoft 365 connected - ITFlow can now use the mailbox");
|
||||
redirect($settings_mail_path);
|
||||
|
||||
Reference in New Issue
Block a user