tout cassé (ㆆ_ㆆ)
This commit is contained in:
parent
b11f67793a
commit
26c81bc3c6
8 changed files with 50 additions and 35 deletions
|
|
@ -212,17 +212,23 @@ class UserCtrl extends MotherCtrl {
|
|||
|
||||
$arrError['user_mail'] = "Ce mail est déjà associé";
|
||||
} else {
|
||||
$objUser->hydrate($_POST);
|
||||
$objUser->setId($_SESSION['user']['user_id']);
|
||||
$boolInsert = $objUserModel->update($objUser);
|
||||
if ($objUserModel->pseudoExists($objUser->getPseudo()) && ($_POST['user_pseudo'] != $objUser->getPseudo())){
|
||||
$arrError['user_pseudo'] = "Ce pseudo est déjà utiliser";
|
||||
}else{
|
||||
$boolInsert = $objUserModel->update($objUser);
|
||||
|
||||
if ($boolInsert === true) {
|
||||
$_SESSION['success'] = "Compte créé avec succès";
|
||||
header("Location:?ctrl=user&action=user&id=".$objUser->getId());
|
||||
exit;
|
||||
} else {
|
||||
$arrError['global'] = "Erreur lors de l'update";
|
||||
}
|
||||
if ($boolInsert === true) {
|
||||
$objUser->hydrate($_POST);
|
||||
$objUser->setPseudo($_SESSION['user']['user_pseudo']);
|
||||
$arrNewInfo = $objUserModel->findUserByPseudo($objUser->getPseudo());
|
||||
$objUser->hydrate($arrNewInfo);
|
||||
$_SESSION['success'] = "Compte modifier avec succès";
|
||||
header("Location:?ctrl=user&action=user&pseudo=".$objUser->getPseudo());
|
||||
exit;
|
||||
} else {
|
||||
$arrError['global'] = "Erreur lors de l'update";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue