diff --git a/.idea/alica.iml b/.idea/alica.iml old mode 100755 new mode 100644 index e7c48eb..9a8e33d --- a/.idea/alica.iml +++ b/.idea/alica.iml @@ -2,15 +2,17 @@ - - - - - + + + + + + + diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..fe47eee --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index e93579d..260af0c 100755 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -4,8 +4,9 @@ diff --git a/.idea/php.xml b/.idea/php.xml old mode 100755 new mode 100644 index 3f67028..2e6d1a6 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -1,14 +1,34 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/php/cache/a2/a28a53cf6f313f83f1634484922e1e19.php b/php/cache/a2/a28a53cf6f313f83f1634484922e1e19.php new file mode 100644 index 0000000..6d702bd --- /dev/null +++ b/php/cache/a2/a28a53cf6f313f83f1634484922e1e19.php @@ -0,0 +1,66 @@ +source = $this->getSourceContext(); + + $this->parent = false; + + $this->blocks = [ + ]; + } + + protected function doDisplay(array $context, array $blocks = []) + { + $macros = $this->macros; + // line 1 + echo " + + + + + Alica - Accueil + + + + + + +"; + } + + public function getTemplateName() + { + return "accueil.html"; + } + + public function getDebugInfo() + { + return array ( 37 => 1,); + } + + public function getSourceContext() + { + return new Source("", "accueil.html", "/Applications/MAMP/htdocs/SAE_2A_FA-Reseau_ALICA/php/vues/accueil.html"); + } +} diff --git a/php/controleur/FrontControleur.php b/php/controleur/FrontControleur.php index b672717..78cc736 100755 --- a/php/controleur/FrontControleur.php +++ b/php/controleur/FrontControleur.php @@ -42,11 +42,13 @@ class FrontControleur public function reinit() { global $twig; // nécessaire pour utiliser variables globales - + echo 'toto'; $dVue = [ 'nom' => '', 'age' => 0, ]; + var_dump($dVue); + echo $twig->render('accueil.html', [ 'dVue' => $dVue ]); diff --git a/php/controleur/UtilisateurControleur.php b/php/controleur/UtilisateurControleur.php index 25f6702..4ca83e6 100755 --- a/php/controleur/UtilisateurControleur.php +++ b/php/controleur/UtilisateurControleur.php @@ -2,7 +2,73 @@ namespace controleur; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; + class UtilisateurControleur { + //Ce controlleur est appelé par le FrontControleur uniquement si l'action demandée est 'utilisateur' (un user lambda non connecté) +public function __construct() + { + global $twig; // nécessaire pour utiliser variables globales + // on démarre ou reprend la session pas utilisée ici + session_start(); + + //debut + //on initialise un tableau d'erreur + $dVueEreur = []; + + try { + $action = $_REQUEST['action'] ?? null; + + switch($action) { + //pas d'action, on réinitialise 1er appel + case null: + $this->reinit(); + break; + case 'connection': + $this->connection(); + break; + default: + $dVueEreur[] = "Erreur d'appel php"; + echo $twig->render('accueil.html', ['dVueEreur' => $dVueEreur]); + break; + } + } catch (\PDOException $e) { + //si erreur BD, pas le cas ici + $dVueEreur[] = 'TODO '; + } catch (\Exception $e2) { + $dVueEreur[] = 'TODO '; + echo $twig->render('erreur.html', ['dVueEreur' => $dVueEreur]); + } + + //fin + exit(0); + }//fin constructeur + + /** + * @throws SyntaxError + * @throws RuntimeError + * @throws LoaderError + */ + private function connection() + { + global $twig; + echo $twig->render('connection.html', []); + } + + public function reinit() + { + global $twig; + $dVue = [ + 'session' => '' + ]; + var_dump($dVue); + + echo $twig->render('accueil.html', [ + 'dVue' => $dVue + ]); + } } \ No newline at end of file diff --git a/php/css/.DS_Store b/php/css/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/php/css/.DS_Store differ diff --git a/php/css/index.css b/php/css/index.css new file mode 100755 index 0000000..12597cc --- /dev/null +++ b/php/css/index.css @@ -0,0 +1,124 @@ +@import url(https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Share+Tech+Mono&display=swap); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; +} +body{ + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + background: #2f363e; +} + +.container{ + position: relative; + width: 350px; + min-height: 500px; + display: flex; + justify-content: center; + align-items: center; + background: #2f363e; + box-shadow: 25px 25px 75px rgba(0,0,0,0.25), + 10px 10px 70px rgba(0,0,0,0.25), + inset 5px 5px 10px rgba(0, 0, 0, 0.5), + inset 5px 5px 10px rgba(255, 255, 255, 0.2), + inset -5px -5px 15px rgba(0, 0, 0, 0.75); + border-radius: 30px; + padding: 50px; +} +form{ + position: relative; + width: 100%; +} +.container h3{ + color: #fff; + font-weight: 600; + font-size: 2em; + width: 100%; + text-align: center; + margin-bottom: 30px; + letter-spacing: 2px; + text-transform: uppercase; +} +.CadreInput +{ + position: relative; + width: 100%; + margin-bottom: 20px; +} +.CadreInput span{ + display: inline-block; + color: #fff; + margin-bottom: 10px; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.75em; + border-left: 4px solid #fff; + padding-left: 4px; + line-height: 1em; +} +.CadreInput .box{ + display: flex; +} +.CadreInput .box .icon{ + position: relative; + min-width: 40px; + height: 40px; + background-color: #a50b12; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; + margin-right: 10px; + color: #fff; + font-size: 1.15em; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); +} +.CadreInput .box input{ + position: relative; + width: 100%; + border: none; + outline: none; + padding: 10px 20px; + border-radius: 30px; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); +} +.CadreInput .box input[type="submit"]{ + background-color: #04070a; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); + color: #fff; + cursor: pointer; + text-transform: uppercase; + letter-spacing: 2px; + font-weight: 600; + margin-top: 10px; +} +label{ + color: #fff; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; + display: flex; + align-items: center; +} +label input{ + margin-right: 5px; +} +.forgot{ + color: #fff; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; +} \ No newline at end of file diff --git a/php/css/login.css b/php/css/login.css new file mode 100755 index 0000000..8ec9cfe --- /dev/null +++ b/php/css/login.css @@ -0,0 +1,140 @@ +@import url(https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Share+Tech+Mono&display=swap); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; +} +a{ + text-decoration: none; +} + +body{ + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + background: #2f363e; +} + +.container{ + position: relative; + width: 350px; + min-height: 500px; + display: flex; + justify-content: center; + align-items: center; + background: #2f363e; + box-shadow: 25px 25px 75px rgba(0,0,0,0.25), + 10px 10px 70px rgba(0,0,0,0.25), + inset 5px 5px 10px rgba(0, 0, 0, 0.5), + inset 5px 5px 10px rgba(255, 255, 255, 0.2), + inset -5px -5px 15px rgba(0, 0, 0, 0.75); + border-radius: 30px; + padding: 50px; +} +form{ + position: relative; + width: 100%; +} +.container h3{ + color: #fff; + font-weight: 600; + font-size: 2em; + width: 100%; + text-align: center; + margin-bottom: 30px; + letter-spacing: 2px; + text-transform: uppercase; +} +.container a:link { + color: #fff; + } +.container a:visited { + color: #fff; + } +.container a:hover { + color: #fff; + } +.container a:active { + color: #fff; + } +.CadreInput +{ + position: relative; + width: 100%; + margin-bottom: 20px; +} +.CadreInput span{ + display: inline-block; + color: #fff; + margin-bottom: 10px; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.75em; + border-left: 4px solid #fff; + padding-left: 4px; + line-height: 1em; +} +.CadreInput .box{ + display: flex; +} +.CadreInput .box .icon{ + position: relative; + min-width: 40px; + height: 40px; + background-color: #a50b12; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; + margin-right: 10px; + color: #fff; + font-size: 1.15em; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); +} +.CadreInput .box input{ + position: relative; + width: 100%; + border: none; + outline: none; + padding: 10px 20px; + border-radius: 30px; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); +} +.CadreInput .box input[type="submit"]{ + background-color: #04070a; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); + color: #fff; + cursor: pointer; + text-transform: uppercase; + letter-spacing: 2px; + font-weight: 600; + margin-top: 10px; +} +label{ + color: #fff; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; + display: flex; + align-items: center; +} +label input{ + margin-right: 5px; +} +.forgot{ + color: #fff; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; +} \ No newline at end of file diff --git a/php/css/register.css b/php/css/register.css new file mode 100755 index 0000000..ecfd614 --- /dev/null +++ b/php/css/register.css @@ -0,0 +1,125 @@ +@import url(https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Share+Tech+Mono&display=swap); +*{ + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Poppins', sans-serif; + text-decoration: none; +} +body{ + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + background: #2f363e; +} + +.container{ + position: relative; + width: 350px; + min-height: 500px; + display: flex; + justify-content: center; + align-items: center; + background: #2f363e; + box-shadow: 25px 25px 75px rgba(0,0,0,0.25), + 10px 10px 70px rgba(0,0,0,0.25), + inset 5px 5px 10px rgba(0, 0, 0, 0.5), + inset 5px 5px 10px rgba(255, 255, 255, 0.2), + inset -5px -5px 15px rgba(0, 0, 0, 0.75); + border-radius: 30px; + padding: 50px; +} +form{ + position: relative; + width: 100%; +} +.container h3{ + color: #fff; + font-weight: 600; + font-size: 2em; + width: 100%; + text-align: center; + margin-bottom: 30px; + letter-spacing: 2px; + text-transform: uppercase; +} +.CadreInput +{ + position: relative; + width: 100%; + margin-bottom: 20px; +} +.CadreInput span{ + display: inline-block; + color: #fff; + margin-bottom: 10px; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.75em; + border-left: 4px solid #fff; + padding-left: 4px; + line-height: 1em; +} +.CadreInput .box{ + display: flex; +} +.CadreInput .box .icon{ + position: relative; + min-width: 40px; + height: 40px; + background-color: #a50b12; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; + margin-right: 10px; + color: #fff; + font-size: 1.15em; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); +} +.CadreInput .box input{ + position: relative; + width: 100%; + border: none; + outline: none; + padding: 10px 20px; + border-radius: 30px; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); +} +.CadreInput .box input[type="submit"]{ + background-color: #04070a; + box-shadow: 5px 5px 7px rgba(0, 0, 0, 0.25), + inset 2px 2px 5px rgba(255, 255, 255, 0.25), + inset -3px -3px 5px rgba(0, 0, 0, 0.5); + color: #fff; + cursor: pointer; + text-transform: uppercase; + letter-spacing: 2px; + font-weight: 600; + margin-top: 10px; +} +label{ + color: #fff; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; + display: flex; + align-items: center; +} +label input{ + margin-right: 5px; +} +.login{ + color: #fff; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 0.85em; +} diff --git a/php/index.php b/php/index.php index eb2368d..7ee88f7 100755 --- a/php/index.php +++ b/php/index.php @@ -9,7 +9,8 @@ use controleur\FrontControleur; /** Configuration twig */ $loader = new \Twig\Loader\FilesystemLoader('vues'); $twig = new \Twig\Environment($loader, [ - 'cache' => __DIR__.'/cache', + 'cache' => false, + 'debug' => true ]); -$cont = new FrontControleur(); +$cont = new \controleur\UtilisateurControleur(); diff --git a/php/vues/accueil.html b/php/vues/accueil.html index d8de189..edf4b5e 100755 --- a/php/vues/accueil.html +++ b/php/vues/accueil.html @@ -6,7 +6,16 @@ Alica - Accueil - + +

Accueil

+

Vous êtes sur la page d'accueil

+

Vous pouvez vous connecter ou vous inscrire

+

Vous pouvez aussi consulter les articles

+

Vous pouvez aussi consulter les articles

+

Connection :

+
+ +
diff --git a/php/vues/connection.html b/php/vues/connection.html new file mode 100644 index 0000000..515a754 --- /dev/null +++ b/php/vues/connection.html @@ -0,0 +1,45 @@ + + + + + + Alica - Connection + + + +
+
+

S'identifier

+
+ Identifiant +
+
+
+ +
+
+
+ Mot de passe +
+
+
+ +
+
+ +
+
+
+ +
+
+ Mot de passe oublié +
S'inscrire +
+
+ + + + \ No newline at end of file