diff options
| author | polo <ordipolo@gmx.fr> | 2025-06-30 17:22:26 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-06-30 17:22:26 +0200 |
| commit | ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f (patch) | |
| tree | a1a27445fd758c16bbb15baa1830118a4f01eca1 /src/controller | |
| parent | ef60a4bd581ec9fb85384c6a262b499373a37d67 (diff) | |
| download | cms-ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f.tar.gz cms-ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f.tar.bz2 cms-ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f.zip | |
formulaire de contact 2
Diffstat (limited to 'src/controller')
| -rw-r--r-- | src/controller/ajax.php | 18 |
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 | ||
