diff --git a/controller/VisitorCtrl.php b/controller/VisitorCtrl.php
index 68de0e9..8c3d756 100644
--- a/controller/VisitorCtrl.php
+++ b/controller/VisitorCtrl.php
@@ -19,7 +19,7 @@ class VisitorCtrl
$action = $_REQUEST['action'];
else
$action = null;
-
+
switch($action){
case null:
$this->loadHome();
@@ -99,7 +99,7 @@ class VisitorCtrl
}
function connection(){
- $this->userModel->connexion($user,$mdp);
+ $this->userModel->connexion($_POST['username'],$_POST['password']);
$this->loadHome();
}
@@ -109,7 +109,8 @@ class VisitorCtrl
}
function register(){
- $this->userModel->ajouter($user,$mdp);
+ $this->userModel->ajouter($_POST['username'],$_POST['password']);
+ $this->go_connection();
}
function go_list(){
diff --git a/dal/UserGateway.php b/dal/UserGateway.php
index 9046375..e9573ed 100644
--- a/dal/UserGateway.php
+++ b/dal/UserGateway.php
@@ -47,8 +47,8 @@
$query = 'SELECT mdp FROM User WHERE login = :login';
$this->con->executeQuery($query, array(':login'=>array($login, PDO::PARAM_STR)));
$result = $this->con->getResults();
- $hash = password_hash($result[0]['mdp'], PASSWORD_BCRYPT, array("cost" => 12));
- if(password_verify($mdp, $hash))
+ echo var_dump($result[0][0])."
";
+ if(password_verify($mdp, $result[0][0]))
return $login;
}
}
diff --git a/view/connection.php b/view/connection.php
index 5033d37..e1c61ef 100644
--- a/view/connection.php
+++ b/view/connection.php
@@ -48,21 +48,22 @@