|
|
|
@ -24,11 +24,12 @@ class UtilisateurControleur
|
|
|
|
|
if (isset($_POST['email'], $_POST['password'])) {
|
|
|
|
|
$email = Validation::nettoyerString($_POST['email']);
|
|
|
|
|
$motDePasse = Validation::nettoyerString($_POST['password']);
|
|
|
|
|
|
|
|
|
|
$utilisateur = $userModel->connection($email, $motDePasse);
|
|
|
|
|
|
|
|
|
|
if ($utilisateur instanceof Alumni) {
|
|
|
|
|
$_SESSION['utilisateur'] = $utilisateur;
|
|
|
|
|
//header('Location: index.php?action=accueil');
|
|
|
|
|
echo $twig->render("inscription_success.html",[]);
|
|
|
|
|
header('Location: accueil');
|
|
|
|
|
exit();
|
|
|
|
|
} else {
|
|
|
|
|
$dVueErreur[] = "L'adresse email ou le mot de passe est incorrect.";
|
|
|
|
@ -39,6 +40,7 @@ class UtilisateurControleur
|
|
|
|
|
|
|
|
|
|
public function inscription()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
global $twig;
|
|
|
|
|
$dVueErreur = []; // Tableau pour stocker les erreurs, le cas échéant
|
|
|
|
|
$userModel = new UtilisateurModele();
|
|
|
|
@ -97,6 +99,7 @@ class UtilisateurControleur
|
|
|
|
|
|
|
|
|
|
public function consultOffers()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$userMdl = new UtilisateurModele();
|
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
|
@ -254,14 +257,14 @@ class UtilisateurControleur
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function displayOffer()
|
|
|
|
|
public function displayOffer(?array $params)
|
|
|
|
|
{
|
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["id"]) && intval($_GET["id"]) != null)
|
|
|
|
|
if (isset($params['id']) && intval($params['id']) != null)
|
|
|
|
|
{
|
|
|
|
|
$uttilsMdl = new UtilisateurModele();
|
|
|
|
|
$offre = $uttilsMdl->getOfferFromId(intval($_GET["id"]));
|
|
|
|
|
$offre = $uttilsMdl->getOfferFromId(intval($params["id"]));
|
|
|
|
|
if($offre != NULL)
|
|
|
|
|
{
|
|
|
|
|
echo $twig->render("OffreDetailTest.html",['offre' => $offre]);
|
|
|
|
|