smarty et merge de tout fini ( ദ്ദി ˙ᗜ˙ )

This commit is contained in:
Yasder5 2026-02-09 11:19:00 +01:00
parent a774205594
commit 6ed4394dda
113 changed files with 11964 additions and 1192 deletions

View file

@ -8,8 +8,8 @@ class UserCtrl extends MotherCtrl {
public function login(){
$strMail = $_POST['mail']??"";
$strPwd = $_POST['pwd']??"";
$strMail = $_POST['user_mail']??"";
$strPwd = $_POST['user_password']??"";
// Tester le formulaire
$arrError = [];
@ -127,13 +127,19 @@ class UserCtrl extends MotherCtrl {
$objUserModel = new UserModel();
$boolInsert = $objUserModel->insert($objUser);
if ($boolInsert === true) {
$_SESSION['success'] = "Compte créé avec succès";
header("Location:index.php?ctrl=user&action=login");
exit;
if ($objUserModel->mailExists($objUser->getMail())) {
$arrError['user_mail'] = "Ce mail existe déjà";
} else {
// Erreur globale (pas liée à un champ)
$arrError['global'] = "Erreur lors de l'ajout";
$boolInsert = $objUserModel->insert($objUser);
if ($boolInsert === true) {
$_SESSION['success'] = "Compte créé avec succès";
header("Location:index.php?ctrl=user&action=login");
exit;
} else {
$arrError['global'] = "Erreur lors de l'ajout";
}
}
}
}