diff --git a/WEB/Controller/AdminController.php b/WEB/Controller/AdminController.php index 1185bf90..2c52c656 100644 --- a/WEB/Controller/AdminController.php +++ b/WEB/Controller/AdminController.php @@ -6,9 +6,8 @@ class AdminController extends UserController { try { global $dsn, $rep, $vues, $error; - parent::__construct(); + // parent::__construct(); $action = $_REQUEST['action']; - //register_event_handler('add_to_queue',array($this,"onAddToQueue")); switch ($action) { case NULL: $this->goToHome(); diff --git a/WEB/Controller/FrontController.php b/WEB/Controller/FrontController.php index 0f7656ae..daebbcb8 100644 --- a/WEB/Controller/FrontController.php +++ b/WEB/Controller/FrontController.php @@ -31,7 +31,7 @@ class FrontController if ($action == NULL) { $_REQUEST['action'] = $action; new AdminController(); - } else if (method_exists('UserController', $action) == false) { + } else if (method_exists('AdminController', $action) == false) { $error = "Action non valide " . $action; require($rep . $view['erreur']); } else { diff --git a/WEB/Model/VisitorModel.php b/WEB/Model/VisitorModel.php index 17af584f..e0fda60d 100644 --- a/WEB/Model/VisitorModel.php +++ b/WEB/Model/VisitorModel.php @@ -71,6 +71,7 @@ class VisitorModel throw new Exception("Mot de passe invalide"); } $estAdmin = $this->utilisateur_gateway->getEstAdminByEmail($email); + var_dump($estAdmin); if ($estAdmin == true) { $_SESSION['role'] = "admin"; } else { diff --git a/WEB/View/src/pages/Admin.html b/WEB/View/src/pages/Admin.php similarity index 96% rename from WEB/View/src/pages/Admin.html rename to WEB/View/src/pages/Admin.php index 556b4ee5..696fc5dc 100644 --- a/WEB/View/src/pages/Admin.html +++ b/WEB/View/src/pages/Admin.php @@ -16,7 +16,6 @@ integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous" /> - diff --git a/WEB/View/src/pages/Main.php b/WEB/View/src/pages/Main.php index c256f1cf..6fa2d950 100644 --- a/WEB/View/src/pages/Main.php +++ b/WEB/View/src/pages/Main.php @@ -39,7 +39,7 @@ class="mb-3 text-uppercase d-flex justify-content-center align-items-center" style="width: 260px; height: 50px"