diff --git a/config/config.php b/config/config.php index 7f5428a..4ab0587 100644 --- a/config/config.php +++ b/config/config.php @@ -3,8 +3,8 @@ $rep=__DIR__.'/../'; - //$con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger'); - $con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL'); + $con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger'); + //$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL'); $TMessage = array(); diff --git a/controller/VisitorCtrl.php b/controller/VisitorCtrl.php index 13785da..4b96f62 100644 --- a/controller/VisitorCtrl.php +++ b/controller/VisitorCtrl.php @@ -118,7 +118,9 @@ class VisitorCtrl } function connection(){ - $this->userModel->connexion($_POST['username'],$_POST['password']); + $isCo = $this->userModel->connexion($_POST['username'],$_POST['password']); + if($isCo) + $this->TMessage[] = 'This user does not exist'; require($this->TabVues["erreur"]); $this->loadHome(); } diff --git a/index.php b/index.php index 9248503..a9c1ba2 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,6 @@ diff --git a/model/UserModel.php b/model/UserModel.php index 3f12220..945f1b6 100644 --- a/model/UserModel.php +++ b/model/UserModel.php @@ -17,10 +17,11 @@ Validation::val_form_mdp($mdp, $TMessage); $result = $this->gat->findUser($login, $mdp); - if(!isset($result)) echo 'not set works'; - else - { + if(!isset($result)){ + return false; + } else { $_SESSION['login'] = $result; + return true; } }