diff --git a/index.php b/index.php index a490e89..b625fbe 100644 --- a/index.php +++ b/index.php @@ -24,7 +24,7 @@ $twig = new \Twig\Environment($loader, [ 'cache' => false, ]); -$twig->addGlobal('racine','/~kekentin/WF/WF-Website'); +$twig->addGlobal('racine','/~lebeaulato/WF-Website'); // /~kekentin/WF/WF-Website $cont = new Controleur\FrontControler($co); diff --git a/public/script/changeData.js b/public/script/changeData.js index a3bbc32..e76bb9f 100644 --- a/public/script/changeData.js +++ b/public/script/changeData.js @@ -1,6 +1,7 @@ function editFieldUsername(id) { var pElement = document.getElementById(id);// Récupérer l'élément

via son identifiant + var currentValue = pElement.textContent.trim();// Obtenir le texte actuel du

// Créer un champ de saisie avec la valeur actuelle @@ -65,13 +66,7 @@ function saveFieldEmail(id, newValue) { return; // Ne pas sauvegarder si l'email n'est pas valide } } - if (id === 'username') { - if (newValue.trim() === "") { - alert('Le nom d\'utilisateur ne peut pas être vide.'); - document.getElementById(id).querySelector('input').focus(); - return; // Ne pas sauvegarder si le nom d'utilisateur est vide - } - } + var pElement = document.getElementById(id); // Récupérer l'élément

via son identifiant @@ -141,8 +136,7 @@ function editFieldPassWd(id) { function savePasswordFields(id, newPassword, confirmPassword) { // Vérification si les champs sont vides if (newPassword.trim() === "" || confirmPassword.trim() === ""){ - alert("Les champs de mot de passe ne doivent pas être vides."); - return; + alert("Le mot de passe n'a pas changé"); } // Vérification de la correspondance des deux mots de passe @@ -150,18 +144,13 @@ function savePasswordFields(id, newPassword, confirmPassword) { var pElement = document.getElementById(id);// Récupérer l'élément

via son identifiant - if(newPassword.length >= 16){ - var maskedPassword = '*'.repeat(16); // Masquer le nouveau mot de passe pour l'affichage - } - else{ - var maskedPassword = "*".repeat(newPassword.length); // Masquer le nouveau mot de passe pour l'affichage - } + // Remplacer les champs input par le texte masqué - pElement.innerHTML = '' + maskedPassword + ' '; + pElement.innerHTML ='Votre mot de passe'; alert('Mot de passe mis à jour avec succès'); - // Possibilité d'ajouter ici une fonction pour envoyer les nouveaux mots de passe au serveur + // fonction pour envoyer les nouveaux mots de passe au serveur } else { alert('Les mots de passe ne correspondent pas.'); diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php index bb7f233..b4cddcd 100644 --- a/src/Controleur/FrontControler.php +++ b/src/Controleur/FrontControler.php @@ -19,7 +19,7 @@ Class FrontControler{ $dVueEreur = []; $router = new \AltoRouter(); - $router->setBasePath('/~kekentin/WF/WF-Website'); + $router->setBasePath('/~lebeaulato/WF-Website'); ///~kekentin/WF/WF-Website $router->map('GET', '/', 'VisitorControler','accueil'); diff --git a/src/Controleur/UserControler.php b/src/Controleur/UserControler.php index 58cd581..6eb68ec 100644 --- a/src/Controleur/UserControler.php +++ b/src/Controleur/UserControler.php @@ -49,7 +49,7 @@ class UserControler { public function addComment(){ $id = $_POST['idQuote']; $this->cMod->createComment($_POST['content'],$_POST['idQuote'],$this->uMod->getIdByUsername($_SESSION['user'])); - header("Location: /~kekentin/WF/WF-Website/quote/$id"); + header("Location: /~lebeaulato/WF-Website/quote/$id"); } @@ -67,7 +67,7 @@ class UserControler { session_unset(); session_destroy(); $_SESSION = array(); - header("Location: /~kekentin/WF/WF-Website/"); + header("Location: /~lebeaulato/WF-Website/"); } public function quiz(array $args){ @@ -109,7 +109,7 @@ class UserControler { session_destroy(); $this->endQuiz($id_quiz, $score); } - else header("Location: /~kekentin/WF/WF-Website/quiz/$id_quiz"); + else header("Location: /~lebeaulato/WF-Website/quiz/$id_quiz"); ///~kekentin/WF/WF-Website } diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php index 22a8191..fea371b 100644 --- a/src/Controleur/VisitorControler.php +++ b/src/Controleur/VisitorControler.php @@ -125,7 +125,7 @@ Class VisitorControler { { $_SESSION['user'] = $pseudo; $_SESSION['role'] = 'user'; - header("Location: /~kekentin/WF/WF-Website/"); + header("Location: /~lebeaulato/WF-Website/"); ///~kekentin/WF/WF-Website/ exit(); }else { diff --git a/vue/profil.php b/vue/profil.php index 5dffffb..6ce71ee 100644 --- a/vue/profil.php +++ b/vue/profil.php @@ -5,7 +5,7 @@ echo $twig->render('head.html.twig', [ 'title' => "Profil", 'style' => "public/styles/styleProfil.css", - 'scripts' => array("public/script/theme-toggle.js") + 'scripts' => array("public/script/theme-toggle.js", "public/script/changeData.js") ]); diff --git a/vue/templates/login.html b/vue/templates/login.html index 8da6981..361f604 100644 --- a/vue/templates/login.html +++ b/vue/templates/login.html @@ -15,7 +15,6 @@

▶ Connexion ◀

-

Identifiant *

diff --git a/vue/templates/profil.html.twig b/vue/templates/profil.html.twig index 4f54010..26dc88b 100644 --- a/vue/templates/profil.html.twig +++ b/vue/templates/profil.html.twig @@ -4,14 +4,13 @@ +

{{ srcUsername }}

+ +

{{ srcEmail }}

-

{{ srcUsername }}

- - -

{{ srcEmail }}

+

Votre mot de passe

-

mot de passe

diff --git a/vue/templates/quoteLittle.html.twig b/vue/templates/quoteLittle.html.twig index 858f718..bfeacb6 100644 --- a/vue/templates/quoteLittle.html.twig +++ b/vue/templates/quoteLittle.html.twig @@ -4,7 +4,7 @@ {% for quote in quotes %}
- {{ quote.carac }} + {{ quote.carac }}

"{{ quote.content }}"

- {{ quote.titleSrc }}