Merge branch 'action&exception' of https://codefirst.iut.uca.fr/git/anna.boudoul/ProjetPHP into action&exception

merge
action&exception
Anna BOUDOUL 2 years ago
commit 1aed93194b

@ -3,8 +3,8 @@
$rep=__DIR__.'/../'; $rep=__DIR__.'/../';
//$con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger'); $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=dbanboudoul', 'anboudoul', 'mdpMYSQL');
$TMessage = array(); $TMessage = array();

@ -118,7 +118,9 @@ class VisitorCtrl
} }
function connection(){ 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(); $this->loadHome();
} }

@ -1,7 +1,6 @@
<?php <?php
require("config/config.php"); require("config/config.php");
require('config/Validation.php'); require('config/Validation.php');
require("view/erreur.php");
require_once("controller/FrontCtrl.php"); require_once("controller/FrontCtrl.php");
$fc = new FrontCtrl($con, $TabVues); $fc = new FrontCtrl($con, $TabVues);
?> ?>

@ -17,10 +17,11 @@
Validation::val_form_mdp($mdp, $TMessage); Validation::val_form_mdp($mdp, $TMessage);
$result = $this->gat->findUser($login, $mdp); $result = $this->gat->findUser($login, $mdp);
if(!isset($result)) echo 'not set works'; if(!isset($result)){
else return false;
{ } else {
$_SESSION['login'] = $result; $_SESSION['login'] = $result;
return true;
} }
} }

Loading…
Cancel
Save