mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
smtp: typed probe errors with per-field UI highlighting on save
This commit is contained in:
@@ -51,9 +51,12 @@ if ($section === 'formulaire') {
|
||||
// Immediately probe the server to validate credentials
|
||||
$test = SmtpRelay::test($db);
|
||||
if ($test['ok']) {
|
||||
App::flash('success', "Paramètres SMTP mis à jour — connexion validée avec succès ✓");
|
||||
App::flash('success', "Paramètres SMTP mis à jour — connexion validée ✓");
|
||||
} else {
|
||||
App::flash('error', "Paramètres sauvegardés, mais le test de connexion SMTP a échoué : " . $test['error']);
|
||||
App::flash('error', "Paramètres sauvegardés, mais le test de connexion a échoué : " . $test['error']);
|
||||
if ($test['field'] !== null) {
|
||||
$_SESSION['_flash_smtp_field'] = $test['field'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
App::flash('error', "Section inconnue.");
|
||||
|
||||
@@ -13,8 +13,10 @@ require_once APP_ROOT . '/src/SmtpRelay.php';
|
||||
$db = new Database();
|
||||
$siteSettings = $db->getAllSettings();
|
||||
$stats = $db->getThesesStats();
|
||||
$smtpSettings = SmtpRelay::getSettings($db);
|
||||
$smtpConfigured = SmtpRelay::isConfigured($db);
|
||||
$smtpSettings = SmtpRelay::getSettings($db);
|
||||
$smtpConfigured = SmtpRelay::isConfigured($db);
|
||||
$smtpErrorField = $_SESSION['_flash_smtp_field'] ?? null;
|
||||
unset($_SESSION['_flash_smtp_field']);
|
||||
|
||||
// ── System section ────────────────────────────────────────────────────────────
|
||||
require_once APP_ROOT . '/src/SystemCache.php';
|
||||
|
||||
Reference in New Issue
Block a user