From 168f30e3ba446c7f9eb4c8d359a0886005a98004 Mon Sep 17 00:00:00 2001 From: Rossetto Date: Mon, 20 Nov 2023 16:20:52 +0100 Subject: [PATCH] resolution of some problem with vue and password --- fluxRSS/src/config/Validation.php | 1 + fluxRSS/src/model/AdminModel.php | 2 +- fluxRSS/templates/listArticle.html | 20 ++++++++++++-------- fluxRSS/templates/listArticleAdmin.html | 10 +++++++--- fluxRSS/templates/listFlux.html | 4 ++++ 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/fluxRSS/src/config/Validation.php b/fluxRSS/src/config/Validation.php index 058290e..e01c142 100755 --- a/fluxRSS/src/config/Validation.php +++ b/fluxRSS/src/config/Validation.php @@ -31,4 +31,5 @@ class Validation $age = 0; } } + } diff --git a/fluxRSS/src/model/AdminModel.php b/fluxRSS/src/model/AdminModel.php index dcace24..ec74fc9 100755 --- a/fluxRSS/src/model/AdminModel.php +++ b/fluxRSS/src/model/AdminModel.php @@ -19,7 +19,7 @@ class AdminModel $lmdp = $gwArticle->login($username); foreach ($lmdp as $motDePasse){ - if (true){//password_verify($mdp,$motDePasse['password']) or $mdp == $motDePasse['password']){ + if (password_verify($mdp,$motDePasse['password']) or $mdp == $motDePasse['password']){ $_SESSION['role'] = 'admin'; $_SESSION['pseudo'] = $username; return new Admin($username,$motDePasse['mail']); diff --git a/fluxRSS/templates/listArticle.html b/fluxRSS/templates/listArticle.html index dca136e..68a627f 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() }} -

-{% endfor %} +{% if dVue.data is defined %} + {% for article in dVue.data %} +

+ {{article.dateStr()}}
+ + {{ article.getTitle() }} + {{ article.getDescription() }} +

+ {% endfor %} +{% else %} +

Pas d'articles à afficher

+{% endif %}