From 423755b019a09111b971e36c53e2557e2f5a704f Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 16 Dec 2025 22:41:57 +0100 Subject: page emails, application du RGPD: table email et nettoyeur, renommage de $id_email --- src/controller/ContactFormController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/controller/ContactFormController.php') diff --git a/src/controller/ContactFormController.php b/src/controller/ContactFormController.php index 181e93c..01faa72 100644 --- a/src/controller/ContactFormController.php +++ b/src/controller/ContactFormController.php @@ -80,4 +80,20 @@ class ContactFormController } die; } + static public function deleteEmail(EntityManager $entityManager, array $json): void + { + $email = $entityManager->find('App\Entity\Email', $json['id']); + $entityManager->remove($email); + $entityManager->flush(); + echo json_encode(['success' => true]); + die; + } + static public function toggleSensitiveEmail(EntityManager $entityManager, array $json): void + { + $email = $entityManager->find('App\Entity\Email', $json['id']); + $email->makeSensitive($json['checked']); + $entityManager->flush(); + echo json_encode(['success' => true, 'checked' => $json['checked'], 'deletion_date' => $email->getDeletionDate()->format('d/m/Y')]); + die; + } } \ No newline at end of file -- cgit v1.2.3