mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
feat: admin audit logging across all admin actions
- AdminLogger: JSON-lines → /var/log/xamxam.log (prod) / storage/logs/admin.log (dev) + best-effort DB mirror to admin_audit_log table - DB: admin_audit_log table, share_links.is_archived column - ShareLink: archive() replaces delete(), toggleActive() returns new state, listActive()/listArchived() split, validateLink blocks archived slugs - All action handlers wired: publish, unpublish, visibility, delete, csv/db export, tfe add/edit, tags, pages, apropos, form-help, access-request, maintenance, settings (formulaire toggles, objet types, smtp update), smtp-test - acces.php: archive button replaces delete; collapsible archived links section - setup-server.sh: provision /var/log/xamxam.log (www-data:xamxam 640)
This commit is contained in:
@@ -52,17 +52,22 @@ $body = <<<HTML
|
||||
</html>
|
||||
HTML;
|
||||
|
||||
require_once APP_ROOT . '/src/AdminLogger.php';
|
||||
|
||||
try {
|
||||
$ok = SmtpRelay::send($db, $to, $subject, $body);
|
||||
if ($ok) {
|
||||
AdminLogger::make()->logSmtpTest($to, true);
|
||||
App::flash('success', "E-mail de test envoyé à « {$to} ».");
|
||||
} else {
|
||||
AdminLogger::make()->logSmtpTest($to, false, 'Send returned false');
|
||||
App::flash('error', "Échec de l'envoi. Vérifiez la configuration SMTP et les logs serveur.");
|
||||
}
|
||||
} catch (SmtpSendException $e) {
|
||||
$detail = $e->isRecipientRejected()
|
||||
? "Adresse rejetée par le serveur ({$to}) : " . $e->smtpResponse
|
||||
: "Erreur SMTP : " . $e->smtpResponse;
|
||||
AdminLogger::make()->logSmtpTest($to, false, $detail);
|
||||
App::flash('error', $detail);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user