[676280, 0, null, null, -2147483648, -2147483648]
diff --git a/.idea/php.xml b/.idea/php.xml
new file mode 100644
index 0000000..1e46886
--- /dev/null
+++ b/.idea/php.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cache/2b/2b8002d11829b35f2fea035ddfbce126.php b/cache/2b/2b8002d11829b35f2fea035ddfbce126.php
new file mode 100644
index 0000000..e318493
--- /dev/null
+++ b/cache/2b/2b8002d11829b35f2fea035ddfbce126.php
@@ -0,0 +1,127 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ S'inscrazeazeazeire ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin2.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin2.html.twig");
+ }
+}
diff --git a/cache/6d/6de321060ef2387bc16f534fbbd8a0cb.php b/cache/6d/6de321060ef2387bc16f534fbbd8a0cb.php
new file mode 100644
index 0000000..6bacc22
--- /dev/null
+++ b/cache/6d/6de321060ef2387bc16f534fbbd8a0cb.php
@@ -0,0 +1,144 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ ";
+ // line 28
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["errors"] ?? null), "html", null, true);
+ yield " ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin4.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin4.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin4.html.twig");
+ }
+}
diff --git a/cache/b7/b796d974978e55de5fca49741812ff6b.php b/cache/b7/b796d974978e55de5fca49741812ff6b.php
new file mode 100644
index 0000000..d34d566
--- /dev/null
+++ b/cache/b7/b796d974978e55de5fca49741812ff6b.php
@@ -0,0 +1,114 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Connexion
+
+
+
+
+
+
+
+
+ ▶ Connexion ◀
+
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "login.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "login.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/login.html.twig");
+ }
+}
diff --git a/cache/b9/b9f06cf0c28af20c02697ea9f4c33b34.php b/cache/b9/b9f06cf0c28af20c02697ea9f4c33b34.php
new file mode 100644
index 0000000..9674c2a
--- /dev/null
+++ b/cache/b9/b9f06cf0c28af20c02697ea9f4c33b34.php
@@ -0,0 +1,144 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ ";
+ // line 28
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
+ yield " ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin5.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin5.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin5.html.twig");
+ }
+}
diff --git a/cache/bb/bb0d1fc28ee0b67e6ef4c12688a04e9a.php b/cache/bb/bb0d1fc28ee0b67e6ef4c12688a04e9a.php
new file mode 100644
index 0000000..c19e758
--- /dev/null
+++ b/cache/bb/bb0d1fc28ee0b67e6ef4c12688a04e9a.php
@@ -0,0 +1,144 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ ";
+ // line 28
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
+ yield " ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin6.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin6.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin6.html.twig");
+ }
+}
diff --git a/cache/c8/c8a54737c049d7059e9d4f0d28a162e3.php b/cache/c8/c8a54737c049d7059e9d4f0d28a162e3.php
new file mode 100644
index 0000000..fc19c20
--- /dev/null
+++ b/cache/c8/c8a54737c049d7059e9d4f0d28a162e3.php
@@ -0,0 +1,144 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ ";
+ // line 28
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
+ yield " ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin7.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin7.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin7.html.twig");
+ }
+}
diff --git a/cache/cb/cb360548e4152dd6e9238cff38b4a902.php b/cache/cb/cb360548e4152dd6e9238cff38b4a902.php
new file mode 100644
index 0000000..90de806
--- /dev/null
+++ b/cache/cb/cb360548e4152dd6e9238cff38b4a902.php
@@ -0,0 +1,144 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ ";
+ // line 28
+ yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["test"] ?? null), "html", null, true);
+ yield " ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin1.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 97 => 48, 89 => 43, 71 => 28, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin1.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin1.html.twig");
+ }
+}
diff --git a/cache/ee/ee32d9ec220b231a48d39e55d4bc37a0.php b/cache/ee/ee32d9ec220b231a48d39e55d4bc37a0.php
new file mode 100644
index 0000000..befba71
--- /dev/null
+++ b/cache/ee/ee32d9ec220b231a48d39e55d4bc37a0.php
@@ -0,0 +1,127 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+ ▶ S'inscrire ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin.html.twig");
+ }
+}
diff --git a/cache/f2/f21f963662b38a0c5b3c81b499f82bfb.php b/cache/f2/f21f963662b38a0c5b3c81b499f82bfb.php
new file mode 100644
index 0000000..a8b3a12
--- /dev/null
+++ b/cache/f2/f21f963662b38a0c5b3c81b499f82bfb.php
@@ -0,0 +1,141 @@
+
+ */
+ private array $macros = [];
+
+ public function __construct(Environment $env)
+ {
+ parent::__construct($env);
+
+ $this->source = $this->getSourceContext();
+
+ $this->parent = false;
+
+ $this->blocks = [
+ ];
+ }
+
+ protected function doDisplay(array $context, array $blocks = []): iterable
+ {
+ $macros = $this->macros;
+ // line 1
+ yield "
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ lo ◀
+
+
+";
+ yield from [];
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getTemplateName(): string
+ {
+ return "signin3.html.twig";
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function isTraitable(): bool
+ {
+ return false;
+ }
+
+ /**
+ * @codeCoverageIgnore
+ */
+ public function getDebugInfo(): array
+ {
+ return array ( 94 => 48, 86 => 43, 42 => 1,);
+ }
+
+ public function getSourceContext(): Source
+ {
+ return new Source("", "signin3.html.twig", "/Users/kiem/Documents/WikiFantasy/WF-Website/vue/templates/signin3.html.twig");
+ }
+}
diff --git a/index.php b/index.php
index 4603285..e7b4c46 100644
--- a/index.php
+++ b/index.php
@@ -11,7 +11,7 @@ require_once __DIR__ . '/config/config.php';
require __DIR__ . '/vendor/autoload.php';
-$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'Chocolat-77');
+$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd');
//twig
$loader = new \Twig\Loader\FilesystemLoader('vue/templates');
diff --git a/public/styles/styleAccueil.css b/public/styles/styleAccueil.css
index 170e1a7..7aa484e 100644
--- a/public/styles/styleAccueil.css
+++ b/public/styles/styleAccueil.css
@@ -1,6 +1,12 @@
@import url(./style.css); /* Import de style.css */
@import url(./styleQuoteLittle.css);
+h2 {
+ text-align: center;
+ font-size: 2em;
+ margin: 20px 0;
+}
+
/* Conteneur général pour les citations */
.citations-section {
display: flex;
diff --git a/public/styles/styleLogin.css b/public/styles/styleLogin.css
index e02bd8f..e0da447 100644
--- a/public/styles/styleLogin.css
+++ b/public/styles/styleLogin.css
@@ -1,130 +1,130 @@
-@import url(./style.css);
-
-/* ====== DARK MODE ====== */
-body.dark-mode h1{
- color : white;
- font-family: "Lemon", serif;
- text-align: center;
- font-size: 32px;
- margin-top: 10%;
-}
-
-body.dark-mode p{
- margin-top: 6%;
- margin-bottom: 2%;
- color : white;
- font-size: 20px;
- font-family: "Lemon", serif;
-}
-
-body.dark-mode .login{
- background-color: black;
- width: 30%;
- margin-left: 35%;
- margin-top: 3%;
- border-radius: 25px;
- border: 2px solid transparent;
- padding: 2%;
-}
-
-body.dark-mode .createAccount{
- margin-top: 5%;
- margin-bottom: 5%;
- font-size: 13px;
- text-align: center;
- padding-top: 1%;
- color: white;
- border: 1px solid transparent;
- font-family: "Lemon", serif;
-}
-
-body.dark-mode .buttonSudmite{
- background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
- font-family: "Lemon", serif;
- border: none;
- color: white;
- padding: 2%;
- border-radius: 25px;
- width: 75%;
- font-size: 20px;
-}
-
-
-body.dark-mode .connexion{
- width:90%;
- height: 40px;
- padding-left: 3%;
- margin-left: 1%;
- margin-top: -1%;
- border-radius: 25px;
- border: none;
- font-size: 15px;
-}
-
-/* ====== LIGHT MODE ====== */
-body.light-mode h1{
- color : black;
- font-family: "Lemon", serif;
- text-align: center;
- font-size: 32px;
- margin-top: 10%;
-}
-
-body.light-mode p{
- margin-top: 6%;
- margin-bottom: 2%;
- color : black;
- font-size: 20px;
- font-family: "Lemon", serif;
-}
-
-body.light-mode .login{
- background-color: white;
- width: 30%;
- margin-left: 35%;
- margin-top: 3%;
- border-radius: 25px;
- border: 2px solid black;
- padding: 2%;
-}
-
-body.light-mode .createAccount{
- margin-top: 5%;
- margin-bottom: 5%;
- font-size: 13px;
- text-align: center;
- padding-top: 1%;
- color: black;
- font-family: "Lemon", serif;
-}
-
-body.light-mode .buttonSudmite{
- background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
- font-family: "Lemon", serif;
- border: none;
- color: black;
- padding: 2%;
- border-radius: 25px;
- width: 75%;
- font-size: 20px;
-}
-
-body.light-mode .connexion{
- width:90%;
- height: 40px;
- padding-left: 3%;
- margin-left: 1%;
- margin-top: -1%;
- border-radius: 25px;
- border: 1px solid black;
- background-color: #fff1f1;
- font-size: 15px;
-}
-
-
-/* ====== DEFAULT ====== */
-.buttonSudmiteDiv{
- text-align: center;
-}
-
-
+@import url(./style.css);
+
+/* ====== DARK MODE ====== */
+body.dark-mode h1{
+ color : white;
+ font-family: "Lemon", serif;
+ text-align: center;
+ font-size: 32px;
+ margin-top: 10%;
+}
+
+body.dark-mode p{
+ margin-top: 6%;
+ margin-bottom: 2%;
+ color : white;
+ font-size: 20px;
+ font-family: "Lemon", serif;
+}
+
+body.dark-mode .login{
+ background-color: black;
+ width: 30%;
+ margin-left: 35%;
+ margin-top: 3%;
+ border-radius: 25px;
+ border: 2px solid transparent;
+ padding: 2%;
+}
+
+body.dark-mode .createAccount{
+ margin-top: 5%;
+ margin-bottom: 5%;
+ font-size: 13px;
+ text-align: center;
+ padding-top: 1%;
+ color: white;
+ border: 1px solid transparent;
+ font-family: "Lemon", serif;
+}
+
+body.dark-mode .buttonSudmite{
+ background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
+ font-family: "Lemon", serif;
+ border: none;
+ color: white;
+ padding: 2%;
+ border-radius: 25px;
+ width: 75%;
+ font-size: 20px;
+}
+
+
+body.dark-mode .connexion{
+ width:90%;
+ height: 40px;
+ padding-left: 3%;
+ margin-left: 1%;
+ margin-top: -1%;
+ border-radius: 25px;
+ border: none;
+ font-size: 15px;
+}
+
+/* ====== LIGHT MODE ====== */
+body.light-mode h1{
+ color : black;
+ font-family: "Lemon", serif;
+ text-align: center;
+ font-size: 32px;
+ margin-top: 10%;
+}
+
+body.light-mode p{
+ margin-top: 6%;
+ margin-bottom: 2%;
+ color : black;
+ font-size: 20px;
+ font-family: "Lemon", serif;
+}
+
+body.light-mode .login{
+ background-color: white;
+ width: 30%;
+ margin-left: 35%;
+ margin-top: 3%;
+ border-radius: 25px;
+ border: 2px solid black;
+ padding: 2%;
+}
+
+body.light-mode .createAccount{
+ margin-top: 5%;
+ margin-bottom: 5%;
+ font-size: 13px;
+ text-align: center;
+ padding-top: 1%;
+ color: black;
+ font-family: "Lemon", serif;
+}
+
+body.light-mode .buttonSubmit{
+ background: linear-gradient(180deg, rgba(187,211,249,1) 0%, rgba(199,246,196,1) 100%);
+ font-family: "Lemon", serif;
+ border: none;
+ color: black;
+ padding: 2%;
+ border-radius: 25px;
+ width: 75%;
+ font-size: 20px;
+}
+
+body.light-mode .connexion{
+ width:90%;
+ height: 40px;
+ padding-left: 3%;
+ margin-left: 1%;
+ margin-top: -1%;
+ border-radius: 25px;
+ border: 1px solid black;
+ background-color: #fff1f1;
+ font-size: 15px;
+}
+
+
+/* ====== DEFAULT ====== */
+.buttonSubmitDiv{
+ text-align: center;
+}
+
+
diff --git a/public/styles/styleSignin.css b/public/styles/styleSignin.css
index 0411e1e..95d2128 100644
--- a/public/styles/styleSignin.css
+++ b/public/styles/styleSignin.css
@@ -1,120 +1,142 @@
-@import url(./style.css);
-
-h1{
- margin-top: 10%;
- text-align: center;
-}
-
-.signin{
- border-radius: 25px;
- display: grid;
- grid-template-columns: 2fr 1fr;
- grid-template-rows: repeat(5, 1fr);
- width : 30%;
- margin-left: 35%;
- margin-top: 3%;
- padding : 2%;
-}
-
-p{
- font-size: 20px;
- margin-top: 7%;
- margin-bottom: 2%;
- font-weight: bold;
-}
-
-.DivId{
- grid-area: 1 / 1 / 2 / 2;
-}
-
-.DivEmail{
- grid-area: 2 / 1 / 3 / 2;
-}
-
-.mdp{
- grid-area: 3 / 1 / 4 / 3;
-}
-
-.confmdp{
- grid-area: 4 / 1 / 5 / 3;
-}
-
-.imgprof{
- grid-area: 1 / 2 / 3 / 3;
-}
-
-.confirmer{
- grid-area: 5 / 1 / 6 / 3;
- align-self: center;
- text-align: center;
-}
-
-.champ{
- width: 90%;
- height : 35%;
- border-radius: 25px;
- margin-left: 1%;
- padding-left: 3%;
- margin-top: -1%;
- font-size: 15px;
-}
-
-.btn{
- margin-top: 10%;
- width:75%;
- font-size: 20px;
- padding: 2%;
- border-radius: 25px;
- border: none;
- font-family: "Lemon", serif;
-}
-
-/*Dark mode*/
-
-body.dark-mode .signin{
- background-color: #000000;
- border: 2px solid transparent;
-}
-
-body.dark-mode .h1{
- color : white;
-}
-
-body.dark-mode .p{
- color : white;
-}
-
-body.dark-mode .btn{
- background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
- color : white;
-}
-
-body.dark-mode .champ{
- background-color: #ffffff;
- border: 2px solid #ffffff;
-}
-
-/*Light*/
-
-body.light-mode .signin{
- background-color: #ffffff;
- border: 2px solid #000000;
-}
-
-body.light-mode .h1{
- color : #000000;
-}
-
-body.light-mode .p{
- color : #000000;
-}
-
-body.light-mode .btn{
- background: linear-gradient(90deg, #caffde 0%, #b7c8ff 100%);
- color : #000000;
-}
-
-body.light-mode .champ{
- background-color: #fff1f1;
- border: 1px solid #000000;
-}
\ No newline at end of file
+@import url(./style.css);
+
+h1{
+ margin-top: 10%;
+ text-align: center;
+}
+
+.signin{
+ border-radius: 25px;
+ display: grid;
+ grid-template-columns: 2fr 1fr;
+ grid-template-rows: repeat(5, 1fr);
+ width : 30%;
+ margin-left: 35%;
+ margin-top: 3%;
+ padding : 2%;
+}
+
+p{
+ font-size: 20px;
+ margin-top: 7%;
+ margin-bottom: 2%;
+ font-weight: bold;
+}
+
+.DivId{
+ grid-area: 1 / 1 / 2 / 2;
+}
+
+.DivEmail{
+ grid-area: 2 / 1 / 3 / 2;
+}
+
+.mdp{
+ grid-area: 3 / 1 / 4 / 3;
+}
+
+.confmdp{
+ grid-area: 4 / 1 / 5 / 3;
+}
+
+.imgprof{
+ grid-area: 1 / 2 / 3 / 3;
+}
+
+.confirmer{
+ grid-area: 5 / 1 / 6 / 3;
+ align-self: center;
+ text-align: center;
+}
+
+.champ{
+ width: 90%;
+ height : 35%;
+ border-radius: 25px;
+ margin-left: 1%;
+ padding-left: 3%;
+ margin-top: -1%;
+ font-size: 15px;
+}
+
+.btn{
+ margin-top: 10%;
+ width:75%;
+ font-size: 20px;
+ padding: 2%;
+ border-radius: 25px;
+ border: none;
+ font-family: "Lemon", serif;
+}
+
+/*Dark mode*/
+
+body.dark-mode .signin{
+ background-color: #000000;
+ border: 2px solid transparent;
+}
+
+body.dark-mode .h1{
+ color : white;
+}
+
+body.dark-mode .p{
+ color : white;
+}
+
+body.dark-mode .btn{
+ background: linear-gradient(90deg, #6100ff 0%, #1b0048 100%);
+ color : white;
+}
+
+body.dark-mode .champ{
+ background-color: #ffffff;
+ border: 2px solid #ffffff;
+}
+
+/*Light*/
+
+body.light-mode .signin{
+ background-color: #ffffff;
+ border: 2px solid #000000;
+}
+
+body.light-mode .h1{
+ color : #000000;
+}
+
+body.light-mode .p{
+ color : #000000;
+}
+
+body.light-mode .btn{
+ background: linear-gradient(90deg, #caffde 0%, #b7c8ff 100%);
+ color : #000000;
+}
+
+body.light-mode .champ{
+ background-color: #fff1f1;
+ border: 1px solid #000000;
+}
+
+
+body.dark-mode .connectAccount{
+ margin-top: 5%;
+ margin-bottom: 5%;
+ font-size: 13px;
+ text-align: center;
+ padding-top: 1%;
+ color: white;
+ border: 1px solid transparent;
+ font-family: "Lemon", serif;
+}
+
+body.light-mode .connectAccount{
+ margin-top: 5%;
+ margin-bottom: 5%;
+ font-size: 13px;
+ text-align: center;
+ padding-top: 1%;
+ color: black;
+ font-family: "Lemon", serif;
+}
diff --git a/src/Controleur/FrontControler.php b/src/Controleur/FrontControler.php
index 5f4813a..5245994 100644
--- a/src/Controleur/FrontControler.php
+++ b/src/Controleur/FrontControler.php
@@ -7,7 +7,7 @@ Class FrontControler{
private $listAction;
- private string $role = 'admin'; //Mettre en admin le temps de créer les comptes
+ private string $role = 'user'; //Mettre en admin le temps de créer les comptes
private Connection $co;
@@ -16,8 +16,8 @@ Class FrontControler{
- $this->listAction = ['visitor' => array('accueil','search','quote','login','signin', 'favorite'),
- 'user' => array('quiz','commentary','logout'),
+ $this->listAction = ['visitor' => array('accueil','search','quote','login','signin'),
+ 'user' => array('quiz','commentary','logout', 'favorite'),
'admin' => array('null')];
$dVueEreur = [];
@@ -42,8 +42,8 @@ Class FrontControler{
$router->map('GET|POST', '/quote/[i:idQuote]', 'VisitorControler','quote');
$router->map('GET|POST', '/login', 'VisitorControler','login');
$router->map('GET|POST', '/signin', 'VisitorControler','signin');
- $router->map('GET|POST', '/favorite', 'VisitorControler','favorite');
-
+ $router->map('GET|POST', '/favorite', 'UserControler','favorite');
+
$router->map('GET', '/quiz/[i:id]?', 'QuizControler','quiz');
$router->map('GET|POST', '/search', 'VisitorControler','search');
diff --git a/src/Controleur/QuizControler.php b/src/Controleur/QuizControler.php
index 47c3cff..28ec2c7 100644
--- a/src/Controleur/QuizControler.php
+++ b/src/Controleur/QuizControler.php
@@ -30,7 +30,7 @@ class QuizControler
* @throws RuntimeError
* @throws LoaderError
*/
- public function __construct(Connection $co)
+ public function __construct(Connection $co, ?string $action = null)
{
$this -> co = $co;
$this -> gw = new QuestionGateway($this -> co);
diff --git a/src/Controleur/UserControler.php b/src/Controleur/UserControler.php
index 1f8d264..2bcd4b6 100644
--- a/src/Controleur/UserControler.php
+++ b/src/Controleur/UserControler.php
@@ -1,23 +1,29 @@
quoteGateway = new QuoteGateway($co);
+ }
+
+ public function quiz() {
global $vues;
require_once $vues['quiz'];
}
- public function favorits() {
+ public function favorite(array $args) {
global $vues;
+
+ $userId = 1;
- $user = $_SESSION['username'];
-
- $idUser = $this->userGateway->getIdUser($user);
+ $favorites = $this->quoteGateway->getFavorites($userId);
-
- $suggestions = $this->favoritsGateway->getFavorits(0, 'fr');
-
- require_once $vues['favorits'];
+ require_once $vues['favorite'];
}
}
diff --git a/src/Controleur/VisitorControler.php b/src/Controleur/VisitorControler.php
index 31409bc..d115928 100644
--- a/src/Controleur/VisitorControler.php
+++ b/src/Controleur/VisitorControler.php
@@ -4,23 +4,65 @@ namespace Controleur;
use Model\QuoteModel;
use Model\SearchModel;
use Gateway\Connection;
-use Gateway\QuoteGateway;
+use Gateway\UserGateway;
+use Model\UserModel;
+use Twig\Error\LoaderError;
+use Twig\Error\RuntimeError;
+use Twig\Error\SyntaxError;
use Gateway\AccueilGateway;
-class VisitorControler {
+Class VisitorControler {
private QuoteModel $qMod;
private AccueilGateway $accueilGateway;
-
private SearchModel $sMod;
- public function __construct(){
+ private UserGateway $gw;
+
+ private UserModel $mdl;
+
+ private array $errors;
+
+ /**
+ * @throws SyntaxError
+ * @throws RuntimeError
+ * @throws LoaderError
+ */
+ public function __construct() {
global $co;
$this->qMod = new QuoteModel(new QuoteGateway($co));
$this->accueilGateway = new AccueilGateway($co);
+ $this->gw = new UserGateway($co);
+ $this->mdl = new UserModel($this->gw);
+ $this -> getAction($action);
}
- public function accueil() {
+ /**
+ * @throws SyntaxError
+ * @throws RuntimeError
+ * @throws LoaderError
+ */
+ public function getAction(string $action): void
+ {
+ switch ($action) {
+ case "login":
+ $this -> visitorLogIn();
+ break;
+ case "signin":
+ $this -> visitorSignIn();
+ break;
+ case "validsignin":
+ $this -> toSignIn();
+ break;
+ case "validlogin":
+ $this -> toLogIn();
+ break;
+ default:
+ break;
+ }
+ }
+
+ public function accueil(){
global $vues;
// Récupérer la citation du jour via AccueilGateway
@@ -31,23 +73,119 @@ class VisitorControler {
require_once $vues['accueil'];
}
- public function quote(array $arg) {
+ public function quote(array $arg){
global $vues;
-
$id=$arg['idQuote'];
-
$q = $this->qMod->searchId($id);
require_once $vues['quote'];
}
- public function login() {
- global $vues;
- require_once $vues['login'];
+ /**
+ * @throws SyntaxError
+ * @throws RuntimeError
+ * @throws LoaderError
+ */
+ public function visitorLogIn(): void
+ {
+ global $twig;
+ echo $twig->render("login.html.twig");
+
+ $this -> toLogIn();
}
- public function signin() {
- global $vues;
- require_once $vues['signin'];
+ public function toLogIn() : void
+ {
+ if ($_POST)
+ {
+ $pseudo = $_POST['pseudo'] ?? null;
+ $mdp = $_POST['mdp'] ?? null;
+
+ $user = $this -> mdl -> getUsername($pseudo);
+
+ if ($user)
+ {
+ if (password_verify($mdp, $user->getPassword()))
+ {
+ $_SESSION['user'] = $pseudo;
+ $_SESSION['role'] = 'user';
+ header("Location: /");
+ exit();
+ }else
+ {
+ global $twig;
+ $this -> errors = ["Identifiant ou mot de passe incorrect"];
+ echo $twig -> render("login.html.twig", ['error' => $this -> errors[0]]);
+ exit();
+ }
+ }
+ else
+ {
+ global $twig;
+ $this -> errors = ["Identifiant ou mot de passe incorrect"];
+ echo $twig -> render("login.html.twig", ['error' => $this -> errors[0]]);
+ exit();
+ }
+ }
+
+ }
+
+ /**
+ * @throws SyntaxError
+ * @throws RuntimeError
+ * @throws LoaderError
+ */
+ public function visitorSignIn(): void
+ {
+ global $twig;
+ echo $twig->render("signin.html.twig");
+ }
+
+
+ /**
+ * @throws RuntimeError
+ * @throws SyntaxError
+ * @throws LoaderError
+ */
+ public function toSignIn() : void
+ {
+ global $twig;
+
+ $this -> errors = [null, null, null];
+
+ if ($_POST) {
+ $pseudo = $_POST['pseudo'] ?? null;
+ $email = $_POST['email'] ?? null;
+ $mdp = $_POST['mdp'] ?? null;
+ $cmdp = $_POST['cmdp'] ?? null;
+
+ if ($mdp != $cmdp) {
+ $this->errors[2] = "Mots de passe incorrects";
+ //$this->visitorSignIn();
+ echo $twig->render("signin.html.twig", ['error' => $this->errors]);
+ exit();
+ }
+ $option = ['cost' => 12];
+ $hmdp = password_hash($mdp, PASSWORD_BCRYPT, $option);
+
+ $isUserAlreadyUsed = $this -> mdl -> getUsername($pseudo);
+ $isEmailAlreadyUsed = $this -> mdl -> getEmail($email);
+
+ if ($isUserAlreadyUsed and !$isEmailAlreadyUsed) {
+ $this->errors[0] = "Pseudo déjà utilisé";
+ echo $twig->render("signin.html.twig", ['error' => $this->errors]);
+ exit();
+ }
+ else if ($isEmailAlreadyUsed and !$isUserAlreadyUsed) {
+ $this->errors[1] = "Email déjà utilisé";
+ echo $twig->render("signin.html.twig", ['error' => $this->errors]);
+ exit();
+ }
+ else echo $this->mdl->insertUser($pseudo, $email, $hmdp);
+
+ $_SESSION["pseudo"] = $pseudo;
+
+ header("Location: /");
+ }
}
public function favorite() {
diff --git a/src/Entity/userEntity.php b/src/Entity/userEntity.php
index 10ef40c..ae58b54 100644
--- a/src/Entity/userEntity.php
+++ b/src/Entity/userEntity.php
@@ -1,124 +1,107 @@
id = $id;
- $this->username = $username;
- $this->passwd = $passwd;
- $this->hidenPasswd = hidenPasswd($passwd);
- $this->img = $img;
- $this->email = $email;
- }
-
- /**
- * @return string
- */
public function getId(): int
{
return $this->id;
}
- /**
- * @param string $id
- */
public function setId(int $id): void
{
$this->id = $id;
}
- /**
- * @return string
- */
- public function getUsername(): string
+ public function getPseudo(): string
{
- return $this->username;
+ return $this->pseudo;
}
- /**
- * @param string $username
- */
- public function setUsername(string $username): void
+ public function setPseudo(string $pseudo): void
{
- $this->username = $username;
+ $this->pseudo = $pseudo;
}
- /**
- * @return string
- */
- public function getImg(): int
+ public function getPassword(): string
{
- return $this->img;
+ return $this->password;
}
- /**
- * @param string $img
- */
- public function setImg(int $img): void
+ public function setPassword(string $password): void
{
- $this->img = $img;
+ $this->password = $password;
}
- /**
- * @return string
- */
public function getEmail(): string
{
return $this->email;
}
- /**
- * @param string $email
- */
public function setEmail(string $email): void
{
$this->email = $email;
}
- /**
- * @return string
- */
- public function getPasswd(): string
+ public function getDate(): string
{
- return $this->passwd;
+ return $this->date;
}
- /**
- * @return string
- */
- public function getHidenPasswd(): string
+ public function setDate(string $date): void
+ {
+ $this->date = $date;
+ }
+
+ public function isAdmin(): bool
+ {
+ return $this->isAdmin;
+ }
+
+ public function setIsAdmin(bool $isAdmin): void
{
- return $this->hidenPasswd;
+ $this->isAdmin = $isAdmin;
+ }
+
+ public function getImgPrfl(): int
+ {
+ return $this->imgPrfl;
+ }
+
+ public function setImgPrfl(int $imgPrfl): void
+ {
+ $this->imgPrfl = $imgPrfl;
}
/**
- * @param string $passwd
+ * @param int $id
+ * @param string $pseudo
+ * @param string $password
+ * @param string $email
+ * @param int $imgPrfl
+ * @param bool $isAdmin
+ * @param string $date
*/
- public function setPasswd(string $passwd): void
+ public function __construct(int $id, string $pseudo, string $password, string $email, int $imgPrfl, bool $isAdmin, string $date)
{
- $this->passwd = $passwd;
- $this->hidenPassWd = hidenPassWd($passwd);
+ $this->id = $id;
+ $this->pseudo = $pseudo;
+ $this->password = $password;
+ $this->email = $email;
+ $this->imgPrfl = $imgPrfl;
+ $this->isAdmin = $isAdmin;
+ $this->date = $date;
}
-
}
// ============================================ En attente du Model ============================================
/*$dsn = "pgsql:host=londres;dbname=dblebeaulato";
diff --git a/src/Gateway/QuoteGateway.php b/src/Gateway/QuoteGateway.php
index c1ad75a..b5b4c97 100644
--- a/src/Gateway/QuoteGateway.php
+++ b/src/Gateway/QuoteGateway.php
@@ -155,6 +155,27 @@ Class QuoteGateway{
return $result;
}
+ public function getFavorites(string $userId): array {
+ $query = "SELECT q.id_quote, q.content, c.caracter, i.imgPath, s.title, s.dateS, q.likes, q.langue
+ FROM Favorite f
+ JOIN Quote q ON f.quote = q.id_quote
+ JOIN Caracter c ON c.id_caracter = q.id_caracter
+ JOIN Source s ON s.id_source = q.id_source
+ JOIN Image i ON c.id_img = i.id_img
+ WHERE f.users = :userId";
+
+ try {
+ $this->con->executeQuery($query, [
+ ':userId' => [$userId, PDO::PARAM_STR]
+ ]);
+ return $this->con->getResults();
+ } catch (PDOException $e) {
+ echo "Erreur dans getFavorites: " . $e->getMessage();
+ return [];
+ }
+ }
+
+
}
?>
\ No newline at end of file
diff --git a/src/Gateway/favoritsGateway.php b/src/Gateway/favoritsGateway.php
index dc2ce93..4c8fa99 100644
--- a/src/Gateway/favoritsGateway.php
+++ b/src/Gateway/favoritsGateway.php
@@ -11,21 +11,5 @@ class AccueilGateway {
$this->con = $con;
}
- public function getSuggestions(int $numpage, string $language): array {
-
- $username = $_SESSION['username'];
- $userId = $this->userGateway->getIdUser($username);
-
- $query = "SELECT q.id_quote, q.content, c.caracter, i.imgPath, s.title, s.dateS, q.likes, q.langue
- FROM Quote q
- JOIN Favorite f ON f.quote = q.id_quote
- JOIN Caracter c ON c.id_caracter = q.id_caracter
- JOIN Source s ON s.id_source = q.id_source
- JOIN Image i ON c.id_img = i.id_img
- WHERE q.isValide = true
- AND q.langue = :language
- AND f.users = :userId";
-
- return $this->con->getResults();
- }
+
}
diff --git a/src/Gateway/userGateway.php b/src/Gateway/userGateway.php
index 1472485..995a6c7 100644
--- a/src/Gateway/userGateway.php
+++ b/src/Gateway/userGateway.php
@@ -1,177 +1,124 @@
con=$con;
}
- public function insert(string $username,string $email,string $passwd):string{
+ public function getNumberOfUsers() : array
+ {
+ $query = "SELECT Count(*) FROM Users";
+
+ $this -> con -> executeQuery($query);
+
+ return $this -> con -> getResults();
+ }
- //crypte passeword
- $passwordEncrypted = crypt($passwd);
- // insertion user
- $query='INSERT INTO Users VALUES (:username,:email,:passwd,CURRENT_DATE,false);';
- $this->con->executeQuery($query,array(':username' => array($u->username,PDO::PARAM_STR),':email' => array($u->email,PDO::PARAM_STR),':passwd' => array($u->passwordEncrypted,PDO::PARAM_STR)));
- return $id;
+ public function insertUser(int $id, string $pseudo, string $email, string $password, bool $isAdmin, int $imgPrfl) : bool {
+ $query = "
+ INSERT INTO Users
+ VALUES (:id, :pseudo, :email, :password, CURRENT_DATE, :isAdmin, :imgPrfl)
+ ";
+ return $this -> con -> executeQuery($query, [
+ ":id" => [$id, PDO::PARAM_INT],
+ ":pseudo" => [$pseudo, PDO::PARAM_STR],
+ ":email" => [$email, PDO::PARAM_STR],
+ ":password" => [$password, PDO::PARAM_STR],
+ ":isAdmin" => [$isAdmin, PDO::PARAM_INT],
+ ":imgPrfl" => [$imgPrfl, PDO::PARAM_STR]
+ ]);
}
-
+
public function delete(string $id) : bool{
- // suppression user
+ // supretion user
$query='DELETE FROM Users WHERE id_user = :id;';
- return $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));
+ return $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR)));
}
-
public function getFavorite(string $id):array{
//obtention favoris d'un user
- $query='SELECT * FROM Quote WHERE id_quote IN (SELECT id_quote IN Favorite f JOIN User u ON u.id_user = f.user WHERE id_user = :id);';
- $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_INT)));
+ $query='SELECT * FROM Quote WHERE id_quote IN (SELECT id_quote FROM Favorite f JOIN users u ON u.id_user = f.user_f WHERE u.id_user = :id);';
+ $this->con->executeQuery($query,array(':id' => array($id,PDO::PARAM_STR)));
$result=$this->con->getResults();
return $result;
}
+
//obtenir les information d'un user
public function findDataUser(int $id):array{
$query = 'SELECT * FROM Users WHERE id_user=:idUser';
- $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT)));
- $result = $con->getResults();
+ $this->con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR)));
+ $result = $this->con->getResults();
return $result;
}
- public function createQuote(int $id, string $content, string $langue, string $caracter, string $source):array{
-
- //recupère id du personnage
- $queryCaracter = "SELECT id_caracter FROM Caracter WHERE caracter =:caracter";
- $con->executeQuery($queryCaracter, array(
- ':caracter'=>array($caracter, PDO::PARAM_STR)
- ));
- $resultCaracter = $con->getResult();
-
- if($resultCaracter == NULL){
- //ajout creationCaracter
- }
-
- //recupère id de la source
- $querySource = "SELECT id_source FROM Source WHERE title =:source";
- $con->executeQuery($querySource, array(
- ':source'=>array($source, PDO::PARAM_STR)
- ));
- $resultSource = $con->getResult();
-
- if($resultSource == NULL){
- //ajout creationSource
- }
- $queryInsert = "INSERT INTO Quote (content, langue, id_caracter, id_source, id_user_verif) VALUES (:content, :langue, :caracter, :source, :idverif)";
- $con->executeQuery($queryInsert, array(
- ':content'=>array($content, PDO::PARAM_STR),
- ':langue'=>array($langue, PDO::PARAM_STR),
- ':caracter'=>array($resultCaracter, PDO::PARAM_STR),
- ':source'=>array($resultSource, PDO::PARAM_STR),
- ':idverif'=>array($id, PDO::PARAM_INT)
- ));
+ // obtenir les informations d'un user selon son pseudo
+ public function findUsername(string $username):array{
+ $query = 'SELECT * FROM Users WHERE username= :username';
+ $this->con->executeQuery($query, array(':username'=>array($username, PDO::PARAM_STR)));
+ return $this->con->getResults();
}
-
-
- public function createCaracter(string $caracter, string $img):array{
- //creation du personnage
- $queryCaracter = "INSERT INTO Caracter(caracter, img_path) VALUES (:caracter, :img)";
- $con->executeQuery($queryCaracter, array(
- ':caracter'=>array($caracter, PDO::PARAM_STR),
- 'img'=>array($img, PDO::PARAM_STR)
- ));
-
- //récuperation de id caracter
- $queryCaracter = "SELECT id_caracter FROM Caracter WHERE caracter =:caracter";
- $con->executeQuery($queryCaracter, array(
- ':caracter'=>array($caracter, PDO::PARAM_STR)
- ));
- $resultCaracter = $con->getResult();
- }
-
-
-
- public function createSource(string $title, string $dateS):array{
- //creation du personnage
- $querySource = "INSERT INTO Source(title, dateS) VALUES (:title, :dateS)";
- $con->executeQuery($querySource, array(
- ':title'=>array($title, PDO::PARAM_STR),
- 'dateS'=>array($dateS, PDO::PARAM_STR)
- ));
-
- //recupère id de la source
- $querySource = "SELECT id_source FROM Source WHERE title =:source";
- $con->executeQuery($querySource, array(
- ':source'=>array($source, PDO::PARAM_STR)
- ));
- $querySource = $con->getResult();
+ public function findEmail(string $email):array{
+ $query = 'SELECT * FROM Users WHERE email = :email';
+ $this->con->executeQuery($query, array(':email'=>array($email, PDO::PARAM_STR)));
+ return $this->con->getResults();
}
// ===================== UPDATE FUNCTION =====================
- public function updateUsername(int $id, string $newUsername):array{
+ public function updateUsername(int $id, string $newUsername):bool{
//Update le nom du user passé en paramètre
$queryUpdate = 'UPDATE Users SET username=:newUsername WHERE id_user=:idUser';
- $con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_INT), ':newUsername'=> array($newUsername, PDO::PARAM_STR)));
+ $this->con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_STR), ':newUsername'=> array($newUsername, PDO::PARAM_STR)));
//Renvoie le nouveau nom du user
$queryReponse = 'SELECT username FROM Users WHERE id_user=:idUser';
- $con->executeQuery($queryReponse, array($id=>array($id, PDO::PARAM_INT)));
- return $result;
+
+ return $this->con->executeQuery($queryReponse, array($id=>array($newUsername, PDO::PARAM_STR)));
}
- public function updateEmail(int $id, string $newEmail):array{
+ public function updateEmail(int $id, string $newEmail):bool{
//Update le email du user passé en paramètre
$queryUpdate = 'UPDATE Users SET email=:newEmail WHERE id_user=:idUser';
- $con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_INT), ':newEmail'=> array($newEmail, PDO::PARAM_STR)));
+ $this->con->executeQuery($queryUpdate, array(':idUser'=>array($id, PDO::PARAM_STR), ':newEmail'=> array($newEmail, PDO::PARAM_STR)));
//Renvoie le nouveau email du user
- $queryReponse = 'SELECT email FROM Users WHERE id_user=:idUser';
- $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_INT)));
- $result = $con->getResults();
- return $result;
+ $queryReponse = 'SELECT email FROM Users WHERE id_user=:idUser';
+ return $this->con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_STR)));
}
public function updateImg(int $id, int $newImg):array{
//Update l'image du user passé en paramètre
- $query = 'UPDATE Users SET img=:newImg WHERE id_user=:idUser';
- $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT), ':newImg'=> array($newImg, PDO::PARAM_STR)));
+ $query = 'UPDATE Users SET img_prfl=:newImg WHERE id_user=:idUser';
+ $this->con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR), ':newImg'=> array($newImg, PDO::PARAM_STR)));
//Renvoie la nouvelle image du user
- $queryReponse = 'SELECT img FROM Users WHERE id_user=:idUser';
- $con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_INT)));
- $result = $con->getResults();
+ $queryReponse = 'SELECT img_prfl FROM Users WHERE id_user=:idUser';
+ $this->con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_STR)));
+ $result = $this->con->getResults();
return $result;
}
public function updatePasswd(int $id, string $newPassWd):array{
-
- //crypte le mot de passe
- $passwordEncrypted = crypt($newPassWd);
-
//Update le passwd du user passé en paramètre
- $query = 'UPDATE Users SET password=:newPassWd WHERE id_user=:idUser';
- $con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_INT), ':newPassWd'=> array($passwordEncrypted, PDO::PARAM_STR)));
- }
+ $query = 'UPDATE Users SET pssword=:newPassWd WHERE id_user=:idUser';
+ $this->con->executeQuery($query, array(':idUser'=>array($id, PDO::PARAM_STR), ':newPassWd'=> array($newPassWd, PDO::PARAM_STR)));
- public function getIdUser(string $username):array{
- $query = 'SELECT id_user FROM Users WHERE username=:username';
- $con->executeQuery($query, array(':username'=>array($username, PDO::PARAM_STR)));
- $result = $con->getResults();
+ //Renvoie le nouveau passwd du user
+ $queryReponse = 'SELECT pssword FROM Users WHERE id_user=:idUser';
+ $this->con->executeQuery($queryReponse, array(':idUser'=>array($id, PDO::PARAM_STR)));
+ $result = $this->con->getResults();
return $result;
}
}
-
-
-
-$uG = new UserGateway(new Connection("pgsql:host=londres;dbname=dblebeaulato","lebeaulato",""));
-
?>
diff --git a/src/Model/userModel.php b/src/Model/userModel.php
index 1064b11..996e951 100644
--- a/src/Model/userModel.php
+++ b/src/Model/userModel.php
@@ -1,77 +1,115 @@
-gateway = $gate;
- }
-
- public function insertUser(string $username,string $email,string $passwd) : User{
- global $rep,$image;
- $id = $this->gateway->insert($username,$email,$passwd);
- $u = new User($id,$usename,$passwd,$rep.$image['default'],$email);
- }
-
- public function deletUser(string $id) : bool{
- return $this->gateway->delete($id);
- }
-
-
- // public function getFavoriteUser(string $id) : array{
- // $res = array();
- // $data = $this->gateway->getFavorite($id);
- // foreach ($data as $favoris) {
- // $res[] = new Quote();
- // }
- // }
-
- public function getDataUser(int $id){
- $res = $this->gateway->findDataUser($id);
- foreach($res as $sources){
- $src[] = new User(
- $sources['id_user'],
- $sources['username'],
- $sources['pssword'],
- $sources['img'],
- $sources['email']
- );
- }
- return $src;
- }
-
-
- public function setUsername(int $id, string $newUsername){
- $res = $this->gateway->updateUsername($id,$newUsername);
- $src[] = $res[0]['username'];
-
- return $src;
- }
-
- public function setEmail(int $id, string $newEmail){
- $res = $this->gateway->updateEmail($id,$newEmail);
- $src[] = $res[0]['email'];
-
- return $src;
- }
-
- public function setImg(int $id, int $newImg){
- $res = $this->gateway->updateImg($id,$newImg);
- $src[] = $res[0]['img'];
-
- return $src;
- }
-
- public function setPassWd(int $id, string $newPassWd){
- $res = $this->gateway->updatePasswd($id,$newPassWd);
- $src[] = $res[0]['pssword'];
-
- return $src;
- }
- }
-
-?>
+gateway = $gate;
+ }
+
+ public function insertUser(string $username,string $email,string $passwd) : bool{
+ /*global $rep,$image;*/
+ return $this->gateway->insertUser($this->getNumberOfUsers() + 1, $username, $email, $passwd, false, 0);
+ }
+
+ public function getNumberOfUsers() : int
+ {
+
+ return $this->gateway->getNumberOfUsers()[0]['count'] ?? 0;
+ }
+
+ public function deleteUser(string $id) : bool{
+ return $this->gateway->delete($id);
+ }
+
+
+ // public function getFavoriteUser(string $id) : array{
+ // $res[0] = array();
+ // $data = $this->gateway->getFavorite($id);
+ // foreach ($data as $favoris) {
+ // $res[0][] = new Quote();
+ // }
+ // }
+
+ public function getDataUser(int $id) : ?UserEntity {
+ $res = $this->gateway->findDataUser($id);
+ if ($res)
+ return new UserEntity(
+ $res[0]['id_user'],
+ $res[0]['username'],
+ $res[0]['pssword'],
+ $res[0]['email'],
+ $res[0]['img_prfl'],
+ $res[0]['is_admin'],
+ $res[0]['creation']
+ );
+ return null;
+ }
+
+ public function getUsername(string $username) : ?UserEntity
+ {
+ $res = $this->gateway->findUsername($username);
+ if ($res)
+ return new UserEntity(
+ $res[0]['id_user'],
+ $res[0]['username'],
+ $res[0]['pssword'],
+ $res[0]['email'],
+ $res[0]['img_prfl'],
+ $res[0]['is_admin'],
+ $res[0]['creation']
+ );
+ return null;
+ }
+
+ public function getEmail(string $email) : ?UserEntity
+ {
+ $res = $this->gateway->findEmail($email);
+ if ($res)
+ return new UserEntity(
+ $res[0]['id_user'],
+ $res[0]['username'],
+ $res[0]['pssword'],
+ $res[0]['email'],
+ $res[0]['img_prfl'],
+ $res[0]['is_admin'],
+ $res[0]['creation']
+ );
+ return null;
+ }
+
+ public function setUsername(int $id, string $newUsername){
+ $res = $this->gateway->updateUsername($id,$newUsername);
+ $src[] = $res[0]['username'];
+
+ return $src;
+ }
+
+ public function setEmail(int $id, string $newEmail){
+ $res = $this->gateway->updateEmail($id,$newEmail);
+ $src[] = $res[0]['email'];
+
+ return $src;
+ }
+
+ public function setImg(int $id, int $newImg){
+ $res = $this->gateway->updateImg($id,$newImg);
+ $src[] = $res[0]['img'];
+
+ return $src;
+ }
+
+ public function setPassWd(int $id, string $newPassWd){
+ $res = $this->gateway->updatePasswd($id,$newPassWd);
+ $src[] = $res[0]['pssword'];
+
+ return $src;
+ }
+ }
+
+?>
diff --git a/vue/accueil.php b/vue/accueil.php
index 7a04730..96f2d0b 100644
--- a/vue/accueil.php
+++ b/vue/accueil.php
@@ -1,40 +1,41 @@
-render('head.html.twig', [
- 'title' => "Accueil",
- 'style' => "public/styles/styleAccueil.css",
-]);
-
-
-// Rendu du bandeau
-echo $twig->render('bandeau.html.twig');
-
-// Vérification de la présence de la "Citation du jour"
-if (!empty($citationDuJour)) {
- echo $twig->render('citation_du_jour.html.twig', [
- 'quote' => $citationDuJour['content'],
- 'movie' => $citationDuJour['title'],
- 'character' => $citationDuJour['caracter'],
- 'year' => $citationDuJour['dates'],
- 'imagePath' => $citationDuJour['imgpath']
- ]);
-} else {
- echo "Aucune citation du jour n'a été trouvée.
";
-}
-
-// Affichage des suggestions de citations
-echo "Suggestions
";
-echo "";
-foreach ($suggestions as $suggestion) {
- echo $twig->render('suggestion.html.twig', [
- 'quote' => $suggestion['content'],
- 'movie' => $suggestion['title'],
- 'character' => $suggestion['caracter'],
- 'year' => $suggestion['dates'],
- 'imagePath' => $suggestion['imgpath']
- ]);
-}
-echo "
";
+render('head.html.twig', [
+ 'title' => "Accueil",
+ 'style' => "public/styles/styleAccueil.css",
+ 'scripts' => array("public/script/theme-toggle.js")
+]);
+
+
+// Rendu du bandeau
+echo $twig->render('bandeau.html.twig');
+
+// Vérification de la présence de la "Citation du jour"
+if (!empty($citationDuJour)) {
+ echo $twig->render('citation_du_jour.html.twig', [
+ 'quote' => $citationDuJour['content'],
+ 'movie' => $citationDuJour['title'],
+ 'character' => $citationDuJour['caracter'],
+ 'year' => $citationDuJour['dates'],
+ 'imagePath' => $citationDuJour['imgpath']
+ ]);
+} else {
+ echo "Aucune citation du jour n'a été trouvée.
";
+}
+
+// Affichage des suggestions de citations
+echo "Suggestions
";
+echo "";
+foreach ($suggestions as $suggestion) {
+ echo $twig->render('suggestion.html.twig', [
+ 'quote' => $suggestion['content'],
+ 'movie' => $suggestion['title'],
+ 'character' => $suggestion['caracter'],
+ 'year' => $suggestion['dates'],
+ 'imagePath' => $suggestion['imgpath']
+ ]);
+}
+echo "
";
?>
\ No newline at end of file
diff --git a/vue/favorits.php b/vue/favorits.php
index b0632c7..f0c944e 100644
--- a/vue/favorits.php
+++ b/vue/favorits.php
@@ -1,25 +1,28 @@
render('head.html.twig', [
- 'title' => "Accueil",
+ 'title' => "Favoris",
'style' => "public/styles/styleAccueil.css",
+ 'scripts' => array("public/script/theme-toggle.js")
]);
-// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
-echo "Favorits
";
-echo "";
-foreach ($suggestions as $suggestion) {
- echo $twig->render('favorits.html.twig', [
- 'quote' => $suggestion['content'],
- 'movie' => $suggestion['title'],
- 'character' => $suggestion['caracter'],
- 'year' => $suggestion['dates'],
- 'imagePath' => $suggestion['imgpath']
- ]);
+if (!empty($favorites)) {
+ echo "
Vos favoris
";
+ echo "
";
+ foreach ($favorites as $favorite) {
+ echo $twig->render('suggestion.html.twig', [
+ 'quote' => $favorite['content'],
+ 'movie' => $favorite['title'],
+ 'character' => $favorite['caracter'],
+ 'year' => $favorite['dates'],
+ 'imagePath' => $favorite['imgpath']
+ ]);
+ }
+ echo "
";
+} else {
+ echo "
Vous n'avez pas encore de favorits
";
}
-echo "
";
-?>
\ No newline at end of file
+?>
diff --git a/vue/templates/login.html.twig b/vue/templates/login.html.twig
new file mode 100644
index 0000000..fb5869e
--- /dev/null
+++ b/vue/templates/login.html.twig
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+ Wiki Fantasy : Connexion
+
+
+
+
+
+
+
+
+ ▶ Connexion ◀
+
+
+
+
\ No newline at end of file
diff --git a/vue/templates/profil.html b/vue/templates/profil.html.twig
similarity index 100%
rename from vue/templates/profil.html
rename to vue/templates/profil.html.twig
diff --git a/vue/templates/quote.html b/vue/templates/quote.html.twig
similarity index 100%
rename from vue/templates/quote.html
rename to vue/templates/quote.html.twig
diff --git a/vue/templates/signin.html.twig b/vue/templates/signin.html.twig
new file mode 100644
index 0000000..715eda3
--- /dev/null
+++ b/vue/templates/signin.html.twig
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+ ▶ S'inscrire ◀
+
+
+
\ No newline at end of file
diff --git a/vue/templates/signin2.html.twig b/vue/templates/signin2.html.twig
new file mode 100644
index 0000000..87c65a3
--- /dev/null
+++ b/vue/templates/signin2.html.twig
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ Wiki Fantasy : Inscription
+
+
+
+
+
+
+
+
+▶ z{{ test }} aeazrazeraz ◀
+
+
+
\ No newline at end of file