diff --git a/WEB/Controller/FrontController.php b/WEB/Controller/FrontController.php index d0c9b39e..6970090c 100644 --- a/WEB/Controller/FrontController.php +++ b/WEB/Controller/FrontController.php @@ -7,16 +7,13 @@ class FrontController global $error, $view, $rep; session_start(); // Check role permissions - echo "FrontController1\n"; if (isset($_SESSION['role'])) { $role = $_SESSION['role']; } else { $role = "visitor"; } // Check if action exists - echo "FrontController2\n"; $action = $_REQUEST['action']; - echo $action . "\n"; if ($role == "user") { if ($action == NULL) { new UserController(); @@ -28,7 +25,6 @@ class FrontController new UserController(); } } else { - echo "FrontController3\n"; new VisitorController(); } } catch (Exception $e) { diff --git a/WEB/Controller/VisitorController.php b/WEB/Controller/VisitorController.php index 6ae02371..34e5fe0e 100644 --- a/WEB/Controller/VisitorController.php +++ b/WEB/Controller/VisitorController.php @@ -2,11 +2,11 @@ class VisitorController { - private EnigmeGateway $enigme_gateway; + private Connection $con; + function __construct() { try { - echo "VisitorController1\n"; global $dsn, $rep, $vues, $error; $model = new VisitorModel(); $action = $_REQUEST['action']; diff --git a/WEB/Model/VisitorModel.php b/WEB/Model/VisitorModel.php index 58c11a9e..5fa7839f 100644 --- a/WEB/Model/VisitorModel.php +++ b/WEB/Model/VisitorModel.php @@ -1,18 +1,18 @@ enigme_gateway = new EnigmeGateway(); - // $this->partie_gateway = new PartieGateway(); - // $this->utilisateur_gateway = new UtilisateurGateway(); + $this->enigme_gateway = new EnigmeGateway(); + $this->partie_gateway = new PartieGateway(); + $this->utilisateur_gateway = new UtilisateurGateway(); } catch (Exception $e) { $error = $e->getMessage(); require($rep . $view['erreur']); @@ -87,7 +87,6 @@ class VisitorModel { global $rep, $vues, $error; try { - echo "Home"; require($rep . $vues['main']); } catch (Exception $e) { $error = "404"; diff --git a/WEB/index.php b/WEB/index.php index dacbdf06..b404917d 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -3,7 +3,7 @@ require_once('./Config/Config.php'); require_once('./Config/Autoload.php'); Autoload::charger(); -echo "index1\n"; +echo "test1\n"; // try { // $con = new Connection($dsn); @@ -31,11 +31,8 @@ echo "index1\n"; // catch (Exception $e2) { // echo $e2->getMessage(); // } -// global $rep, $vues, $error; -// 'View/src/pages/Erreur.php' -// require($rep.$vues['erreur']); $control = new FrontController(); -echo "index2\n"; +// echo "test2\n"; //session_regenerate_id(true); // session_unset();