diff --git a/fluxRSS/src/config/Validation.php b/fluxRSS/src/config/Validation.php index 058290e..e8b968b 100755 --- a/fluxRSS/src/config/Validation.php +++ b/fluxRSS/src/config/Validation.php @@ -1,6 +1,8 @@ addFluxBySrc($_POST['fluxAdd']); + if(Validation::ValidationFlux($_POST['fluxAdd'])){ + $fluxModel->addFluxBySrc($_POST['fluxAdd']); + } $_REQUEST['action'] = 'listFlux'; unset($_POST['fluxAdd']); $this->init(); diff --git a/fluxRSS/src/model/AdminModel.php b/fluxRSS/src/model/AdminModel.php index dcace24..1694125 100755 --- a/fluxRSS/src/model/AdminModel.php +++ b/fluxRSS/src/model/AdminModel.php @@ -2,6 +2,7 @@ namespace model; +use config\Validation; use DAL\AdminGateway; use DAL\Connection; use metier\Admin; @@ -12,17 +13,19 @@ class AdminModel * @throws \Exception */ public function connection (string $username, string $mdp){ - //Validation::validationLogin($username); - //Validation::validationMdp($mdp); - $gwArticle = new AdminGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto','rorossetto','tpphp')); - $lmdp = $gwArticle->login($username); - foreach ($lmdp as $motDePasse){ - if (true){//password_verify($mdp,$motDePasse['password']) or $mdp == $motDePasse['password']){ - $_SESSION['role'] = 'admin'; - $_SESSION['pseudo'] = $username; - return new Admin($username,$motDePasse['mail']); + $gwArticle = new AdminGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto','rorossetto','tpphp')); + if (Validation::validationLogin($username)){ + $lmdp = $gwArticle->login($username); + } + if(Validation::validationMdp($mdp)){ + foreach ($lmdp as $motDePasse){ + if (password_verify($mdp,$motDePasse['password']) or $mdp == $motDePasse['password']){ + $_SESSION['role'] = 'admin'; + $_SESSION['pseudo'] = $username; + return new Admin($username,$motDePasse['mail']); + } } } return null; diff --git a/fluxRSS/templates/listArticle.html b/fluxRSS/templates/listArticle.html index 62a66c8..82912a6 100755 --- a/fluxRSS/templates/listArticle.html +++ b/fluxRSS/templates/listArticle.html @@ -23,14 +23,18 @@ -{% for article in dVue.data %} -
- {{article.dateStr()}}
-
- {{ article.getTitle() }}
- {{ article.getDescription() }}
-
+ {{article.dateStr()}}
+
+ {{ article.getTitle() }}
+ {{ article.getDescription() }}
+
Pas d'articles à afficher
+{% endif %}