diff --git a/WEB/Controller/FrontController.php b/WEB/Controller/FrontController.php index b230c9a3..8870beaf 100644 --- a/WEB/Controller/FrontController.php +++ b/WEB/Controller/FrontController.php @@ -1,7 +1,7 @@ getMessage(); require ($rep . $vues['erreur']); diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 162e683c..a1fc969e 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -4,11 +4,11 @@ class UserController { private Connection $con; - function __construct($con) { + function __construct() { try{ echo "UserController"; global $dsn, $rep, $vues, $error; - $this->con=$con; + $this->con=new Connection($dsn); echo "USconection"; $action=$_REQUEST['action']; switch($action) { diff --git a/WEB/Controller/UtilisateurGateway.php b/WEB/Controller/UtilisateurGateway.php index a7265fab..cf92a54b 100644 --- a/WEB/Controller/UtilisateurGateway.php +++ b/WEB/Controller/UtilisateurGateway.php @@ -72,7 +72,6 @@ class UtilisateurGateway } public function getEstAdminByEmail(string $email) : bool{ - global $error; $query = "SELECT estAdmin FROM Utilisateur WHERE email=:email"; $this->con->executeQuery($query, array( ':email' => array($email,PDO::PARAM_STR) diff --git a/WEB/index.php b/WEB/index.php index ac74911b..6e187b71 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -18,9 +18,9 @@ Autoload::charger(); // } echo "test"; -$con = new Connection($dsn); +$db = new Connection($dsn); echo "test2"; -$control = new FrontController($con); +$control = new FrontController(); //session_regenerate_id(true); // session_unset();