diff options
Diffstat (limited to 'src/controller')
| -rw-r--r-- | src/controller/ContactFormController.php | 4 | ||||
| -rw-r--r-- | src/controller/UserController.php | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/controller/ContactFormController.php b/src/controller/ContactFormController.php index cbc1837..e078af2 100644 --- a/src/controller/ContactFormController.php +++ b/src/controller/ContactFormController.php | |||
| @@ -28,7 +28,7 @@ class ContactFormController | |||
| 28 | } | 28 | } |
| 29 | static public function setEmailParam(EntityManager $entityManager, array $json): JsonResponse | 29 | static public function setEmailParam(EntityManager $entityManager, array $json): JsonResponse |
| 30 | { | 30 | { |
| 31 | $form = new FormValidation($json, 'email_params'); | 31 | $form = new FormValidation($json, ValidationStrategy::EmailParam); |
| 32 | 32 | ||
| 33 | if($form->validate()){ | 33 | if($form->validate()){ |
| 34 | $form_data = $entityManager->find(EmailForm::class, $json['id']); | 34 | $form_data = $entityManager->find(EmailForm::class, $json['id']); |
| @@ -45,7 +45,7 @@ class ContactFormController | |||
| 45 | // les deux méthodes suivantes sont "factorisables", elles ne se distinguent que par la gestion ou non du formulaire rempli par le visiteur | 45 | // les deux méthodes suivantes sont "factorisables", elles ne se distinguent que par la gestion ou non du formulaire rempli par le visiteur |
| 46 | static public function sendVisitorEmail(EntityManager $entityManager, array $json): JsonResponse | 46 | static public function sendVisitorEmail(EntityManager $entityManager, array $json): JsonResponse |
| 47 | { | 47 | { |
| 48 | $form = new FormValidation($json, 'email_send'); | 48 | $form = new FormValidation($json, ValidationStrategy::EmailSend); |
| 49 | 49 | ||
| 50 | $error = ''; | 50 | $error = ''; |
| 51 | if($form->validate()){ | 51 | if($form->validate()){ |
diff --git a/src/controller/UserController.php b/src/controller/UserController.php index 03686ee..750b01b 100644 --- a/src/controller/UserController.php +++ b/src/controller/UserController.php | |||
| @@ -25,7 +25,7 @@ class UserController | |||
| 25 | { | 25 | { |
| 26 | unset($_SESSION['user']); | 26 | unset($_SESSION['user']); |
| 27 | 27 | ||
| 28 | $form = new FormValidation($_POST, 'create_user'); | 28 | $form = new FormValidation($_POST, ValidationStrategy::CreateUser); |
| 29 | 29 | ||
| 30 | $url = new URL; | 30 | $url = new URL; |
| 31 | $error = ''; | 31 | $error = ''; |
| @@ -58,7 +58,7 @@ class UserController | |||
| 58 | } | 58 | } |
| 59 | unset($_SESSION['user']); | 59 | unset($_SESSION['user']); |
| 60 | 60 | ||
| 61 | $form = new FormValidation($_POST, 'connection'); | 61 | $form = new FormValidation($_POST, ValidationStrategy::Connection); |
| 62 | 62 | ||
| 63 | $error = ''; | 63 | $error = ''; |
| 64 | if($form->validate()){ | 64 | if($form->validate()){ |
| @@ -135,7 +135,7 @@ class UserController | |||
| 135 | $url = new URL(['page' => 'user_edit']); | 135 | $url = new URL(['page' => 'user_edit']); |
| 136 | isset($_GET['from']) ? $url->addParams(['from' => $_GET['from']]) : null; | 136 | isset($_GET['from']) ? $url->addParams(['from' => $_GET['from']]) : null; |
| 137 | 137 | ||
| 138 | $form = new FormValidation($_POST, 'username_update'); | 138 | $form = new FormValidation($_POST, ValidationStrategy::UsernameUpdate); |
| 139 | 139 | ||
| 140 | $error = ''; | 140 | $error = ''; |
| 141 | if($form->validate()){ | 141 | if($form->validate()){ |
| @@ -174,7 +174,7 @@ class UserController | |||
| 174 | $url = new URL(['page' => 'user_edit']); | 174 | $url = new URL(['page' => 'user_edit']); |
| 175 | isset($_GET['from']) ? $url->addParams(['from' => $_GET['from']]) : null; | 175 | isset($_GET['from']) ? $url->addParams(['from' => $_GET['from']]) : null; |
| 176 | 176 | ||
| 177 | $form = new FormValidation($_POST, 'password_update'); | 177 | $form = new FormValidation($_POST, ValidationStrategy::PasswordUpdate); |
| 178 | 178 | ||
| 179 | $error = ''; | 179 | $error = ''; |
| 180 | if($form->validate()){ | 180 | if($form->validate()){ |
