diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index ed27fa94..72cf0162 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -11,7 +11,7 @@ $sel = "JeSuisUnSeldeHashageEtJeSuisUniqueEtTresSecuriseEtJeSuisTresLong"; //View //Page -$vues['main'] = 'View/src/pages/Main.php'; +$vues['main'] = 'View/src/pages/Main2.php'; $vues['presentation'] = 'View/src/pages/Presentation.html'; $vues['login'] = 'View/src/pages/LogSign/Login.php'; $vues['signUp'] = 'View/src/pages/LogSign/SignUp.php'; diff --git a/WEB/Model/AdminModel.php b/WEB/Model/AdminModel.php index 8472f7db..a950943c 100644 --- a/WEB/Model/AdminModel.php +++ b/WEB/Model/AdminModel.php @@ -61,7 +61,8 @@ async function submit(){ } public function editEnigme(int $id, string $nom,string $enonce,string $aide,string $rappel,string $exemple,string $test,string $solution, string $prompt) : Enigme { - $ordre = $this->enigme_gateway->findById($id)[0]->getOrdre(); + $old = $this->enigme_gateway->findById($id)[0]; + $ordre = $old->getOrdre(); $enigme = new Enigme($id,$nom, $enonce, $aide, $rappel, $exemple, $solution, $test, $ordre, 0, 0, $prompt); $this->enigme_gateway->update($enigme); $js = fopen("View/src/JS/$nom.js", "w"); @@ -77,6 +78,9 @@ async function submit(){ check(); }"); fclose($js); + if ($old->getNom() != $nom){ + unlink('View/src/JS/'.$old->getNom().'.js'); + } } else { throw new Exception("Impossible d'ouvrir le fichier"); } diff --git a/WEB/Model/VisitorModel.php b/WEB/Model/VisitorModel.php index 17af584f..bcbc1b3e 100644 --- a/WEB/Model/VisitorModel.php +++ b/WEB/Model/VisitorModel.php @@ -51,6 +51,7 @@ class VisitorModel $this->utilisateur_gateway->insert($utilisateur); $_SESSION['role'] = 'user'; $_SESSION['utilisateur'] = $utilisateur; + $_SESSION['pseudo'] = $utilisateur->getPseudo(); } public function login() { @@ -78,5 +79,6 @@ class VisitorModel } $_SESSION['utilisateur'] = $utilisateur; $_SESSION['connected'] = 'true'; + $_SESSION['pseudo'] = $utilisateur->getPseudo(); } } \ No newline at end of file diff --git a/WEB/View/src/CSS/Main2.css b/WEB/View/src/CSS/Main2.css index 1327f16c..42909ed2 100644 --- a/WEB/View/src/CSS/Main2.css +++ b/WEB/View/src/CSS/Main2.css @@ -139,7 +139,7 @@ button:focus { /* Button Login/ Logout animation */ -button { +a { position: relative; display: inline-block; cursor: pointer; @@ -152,12 +152,12 @@ button { font-family: inherit; } -button.logButton { +a.logButton { width: 12rem; height: 50px; } -button.logButton .circle { +a.logButton .circle { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); display: block; margin: 0; @@ -166,7 +166,7 @@ button.logButton .circle { background: #fff; border-radius: 1.625rem; } -button.logButton .circle .icon { +a.logButton .circle .icon { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); position: absolute; top: 0; @@ -174,14 +174,14 @@ button.logButton .circle .icon { margin: auto; background: #050e15; } -button.logButton .circle .icon.arrow { +a.logButton .circle .icon.arrow { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); left: 0.625rem; width: 1.125rem; height: 0.125rem; background: none; } -button.logButton .circle .icon.arrow::before { +a.logButton .circle .icon.arrow::before { position: absolute; content: ""; top: -0.25rem; @@ -192,7 +192,7 @@ button.logButton .circle .icon.arrow::before { border-right: 0.125rem solid #050e15; transform: rotate(45deg); } -button.logButton .button-text { +a.logButton .button-text { transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1); position: absolute; top: 0; @@ -208,16 +208,16 @@ button.logButton .button-text { text-transform: uppercase; } -button:hover .circle { +a:hover .circle { width: 100%; } -button:hover .circle .icon.arrow { +a:hover .circle .icon.arrow { background: #050e15; transform: translate(1rem, 0); } -button:hover .button-text { +a:hover .button-text { color: #050e15; } diff --git a/WEB/View/src/pages/Main2.php b/WEB/View/src/pages/Main2.php new file mode 100644 index 00000000..8be481fc --- /dev/null +++ b/WEB/View/src/pages/Main2.php @@ -0,0 +1,164 @@ + + +
+ + +' .$_SESSION['pseudo'].'
+ +