aboutsummaryrefslogtreecommitdiff
path: root/src/controller/UserController.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-07-26 13:42:25 +0200
committerpolo <ordipolo@gmx.fr>2026-07-26 13:42:25 +0200
commit2c89c0ec184c0ed76562c899722bb3615cd83add (patch)
treec0006cf58164533ae34ec113d683e8a5f106098d /src/controller/UserController.php
parent0458c5dc4a8e36737f45d6813af24b08f0958688 (diff)
downloadcms-2c89c0ec184c0ed76562c899722bb3615cd83add.tar.gz
cms-2c89c0ec184c0ed76562c899722bb3615cd83add.tar.bz2
cms-2c89c0ec184c0ed76562c899722bb3615cd83add.zip
choix d'une stratégie par type d'objet, suppression des isset inutiles, suppression de $validated
Diffstat (limited to 'src/controller/UserController.php')
-rw-r--r--src/controller/UserController.php8
1 files changed, 4 insertions, 4 deletions
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()){