Correction de bug avec le controller admin
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 4c6cbf0d3c
commit 15437cdbe6

@ -6,9 +6,8 @@ class AdminController extends UserController
{ {
try { try {
global $dsn, $rep, $vues, $error; global $dsn, $rep, $vues, $error;
parent::__construct(); // parent::__construct();
$action = $_REQUEST['action']; $action = $_REQUEST['action'];
//register_event_handler('add_to_queue',array($this,"onAddToQueue"));
switch ($action) { switch ($action) {
case NULL: case NULL:
$this->goToHome(); $this->goToHome();

@ -31,7 +31,7 @@ class FrontController
if ($action == NULL) { if ($action == NULL) {
$_REQUEST['action'] = $action; $_REQUEST['action'] = $action;
new AdminController(); new AdminController();
} else if (method_exists('UserController', $action) == false) { } else if (method_exists('AdminController', $action) == false) {
$error = "Action non valide " . $action; $error = "Action non valide " . $action;
require($rep . $view['erreur']); require($rep . $view['erreur']);
} else { } else {

@ -71,6 +71,7 @@ class VisitorModel
throw new Exception("Mot de passe invalide"); throw new Exception("Mot de passe invalide");
} }
$estAdmin = $this->utilisateur_gateway->getEstAdminByEmail($email); $estAdmin = $this->utilisateur_gateway->getEstAdminByEmail($email);
var_dump($estAdmin);
if ($estAdmin == true) { if ($estAdmin == true) {
$_SESSION['role'] = "admin"; $_SESSION['role'] = "admin";
} else { } else {

@ -39,7 +39,7 @@
class="mb-3 text-uppercase d-flex justify-content-center align-items-center" class="mb-3 text-uppercase d-flex justify-content-center align-items-center"
style="width: 260px; height: 50px" style="width: 260px; height: 50px"
<?php <?php
if (isset($_SESSION['role']) && $_SESSION['role'] == 'user'){ if (isset($_SESSION['role']) && $_SESSION['role'] == 'user' || isset($_SESSION['role']) && $_SESSION['role'] == 'admin'){
echo 'href="index.php?action=goToPresentation"'; echo 'href="index.php?action=goToPresentation"';
} }
else{ else{

Loading…
Cancel
Save