|
|
@ -4,11 +4,7 @@
|
|
|
|
namespace App\controleur;
|
|
|
|
namespace App\controleur;
|
|
|
|
|
|
|
|
|
|
|
|
use App\router\AltoRouter;
|
|
|
|
use App\router\AltoRouter;
|
|
|
|
use App\metier\Alumni;
|
|
|
|
use App\controleur\Error;
|
|
|
|
|
|
|
|
|
|
|
|
use App\controleur\UtilisateurControleur;
|
|
|
|
|
|
|
|
use App\controleur\MembreControleur;
|
|
|
|
|
|
|
|
use App\controleur\AdminControleur;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FrontControleur
|
|
|
|
class FrontControleur
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -72,12 +68,28 @@ class FrontControleur
|
|
|
|
|
|
|
|
|
|
|
|
//var_dump($match);
|
|
|
|
//var_dump($match);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$namespace = 'App\\controleur\\';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "action: ".$action;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if ($controller == "MembreControleur") {
|
|
|
|
if ($controller == "MembreControleur") {
|
|
|
|
if ($_SESSION["utilisateur"]->getRole() != "Admin" || $_SESSION["utilisateur"]->getRole() != "Membre") {
|
|
|
|
|
|
|
|
|
|
|
|
echo " on est passés ici";
|
|
|
|
|
|
|
|
echo "role ".$_SESSION["utilisateur"]->getRole();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($_SESSION["utilisateur"]->getRole() != "Membre") {
|
|
|
|
|
|
|
|
|
|
|
|
echo $twig->render("connection.html",['msg' => 'Vous devez vous connecter pour effectuer cette action']);
|
|
|
|
echo $twig->render("connection.html",['msg' => 'Vous devez vous connecter pour effectuer cette action']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
$controller = "MembreControleur";
|
|
|
|
|
|
|
|
$controller = $namespace . $controller;
|
|
|
|
|
|
|
|
echo "controller : ".$controller;
|
|
|
|
|
|
|
|
$controller = new $controller();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($controller == "AdminControleur") {
|
|
|
|
if ($controller == "AdminControleur") {
|
|
|
@ -89,13 +101,17 @@ class FrontControleur
|
|
|
|
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
|
|
|
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
$namespace = 'App\\Controleur\\';
|
|
|
|
if($controller == "UtilisateurControleur")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$controller = $namespace . $controller;
|
|
|
|
$controller = $namespace . $controller;
|
|
|
|
$controller = new $controller();
|
|
|
|
$controller = new $controller();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (is_callable(array($controller, $action))) {
|
|
|
|
if (is_callable(array($controller, $action))) {
|
|
|
|
|
|
|
|
echo "action callable";
|
|
|
|
|
|
|
|
|
|
|
|
call_user_func(array($controller, $action), $match['params']);
|
|
|
|
call_user_func(array($controller, $action), $match['params']);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|