summaryrefslogtreecommitdiff
path: root/src/controller/ajax.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller/ajax.php')
-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