summaryrefslogtreecommitdiff
path: root/src/controller
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-06-30 17:22:26 +0200
committerpolo <ordipolo@gmx.fr>2025-06-30 17:22:26 +0200
commitea3eaf84c6de3f96d6bb73e817147f8571fd6c1f (patch)
treea1a27445fd758c16bbb15baa1830118a4f01eca1 /src/controller
parentef60a4bd581ec9fb85384c6a262b499373a37d67 (diff)
downloadcms-ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f.zip
formulaire de contact 2
Diffstat (limited to 'src/controller')
-rw-r--r--src/controller/ajax.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/controller/ajax.php b/src/controller/ajax.php
index a462921..ae43b75 100644
--- a/src/controller/ajax.php
+++ b/src/controller/ajax.php
@@ -353,6 +353,24 @@ if($_SERVER['CONTENT_TYPE'] === 'application/json'){
353 echo json_encode(['success' => true]); 353 echo json_encode(['success' => true]);
354 die; 354 die;
355 } 355 }
356
357 // config formulaire
358 elseif($_GET['action'] === 'recipient_email'){
359 $form_data = $entityManager->find('App\Entity\NodeData', $json['id']);
360 $email = htmlspecialchars(trim($json['email']));
361
362 if(filter_var($email, FILTER_VALIDATE_EMAIL)){
363 $form_data->updateData('email', $json['email']);
364 $entityManager->persist($form_data);
365 $entityManager->flush();
366 echo json_encode(['success' => true]);
367 die;
368 }
369 else{
370 echo json_encode(['success' => false]);
371 die;
372 }
373 }
356 } 374 }
357 375
358 376