diff options
Diffstat (limited to 'src/view/templates')
-rw-r--r-- | src/view/templates/login.php | 28 | ||||
-rw-r--r-- | src/view/templates/user_create.php | 52 | ||||
-rw-r--r-- | src/view/templates/user_edit.php | 62 |
3 files changed, 142 insertions, 0 deletions
diff --git a/src/view/templates/login.php b/src/view/templates/login.php new file mode 100644 index 0000000..766c114 --- /dev/null +++ b/src/view/templates/login.php | |||
@@ -0,0 +1,28 @@ | |||
1 | <?php declare(strict_types=1); ?> | ||
2 | <section> | ||
3 | <h3 class="connexionTitre" >Connexion à l'espace d'administration</h3> | ||
4 | <div class="login_form"> | ||
5 | <p class="connexionP" >Veuillez saisir votre identifiant et votre mot de passe.</p> | ||
6 | <p style="color: red; font-style: italic;"><?= $error ?></p> | ||
7 | <form class="connexionFormulaire" method="post" action="<?= $link_form ?>" > | ||
8 | <p><label for="login" >Identifiant:</label> | ||
9 | <input id="login" type="text" name="login" autofocus required></p> | ||
10 | <p><label for="password" >Mot de passe:</label> | ||
11 | <input id="password" type="password" name="password" required></p> | ||
12 | |||
13 | <p>Montrez que vous n'êtes pas un robot.<br> | ||
14 | <label for="captcha" >Combien font <?= $captcha->getA() ?> fois <?= $captcha->getB() ?>?</label> | ||
15 | <input required type="text" id="captcha" name="captcha" autocomplete="off" size="1"> | ||
16 | </p> | ||
17 | |||
18 | <input type="submit" value="Valider"> | ||
19 | </form> | ||
20 | <p class='connexionP' >Au fait? Vous n'utilisez pas votre propre ordinateur ou téléphone?<br/> | ||
21 | Utilisez la navigation privée.</p> | ||
22 | <p class="connexionP connexionFooter" > | ||
23 | <a href="<?= $link_exit ?>" > | ||
24 | <button>Retour au site</button> | ||
25 | </a> | ||
26 | </p> | ||
27 | </div> | ||
28 | </section> \ No newline at end of file | ||
diff --git a/src/view/templates/user_create.php b/src/view/templates/user_create.php new file mode 100644 index 0000000..dd17547 --- /dev/null +++ b/src/view/templates/user_create.php | |||
@@ -0,0 +1,52 @@ | |||
1 | <?php | ||
2 | declare(strict_types=1); | ||
3 | |||
4 | $error_messages = [ | ||
5 | 'error_non_valid_captcha' => 'Erreur au test anti-robot, veuillez saisir un nombre entier.', | ||
6 | 'captcha_server_error' => 'captcha_server_error', | ||
7 | 'bad_solution_captcha' => 'Erreur au test anti-robot, veuillez réessayer.', | ||
8 | 'different_passwords' => 'Les deux mots de passe saisis sont différents', | ||
9 | 'forbidden_characters' => 'Caractères interdits: espaces, tabulations, sauts CR/LF.' | ||
10 | ]; | ||
11 | $error = isset($_GET['error']) ? $error_messages[$_GET['error']] : ''; | ||
12 | |||
13 | $captcha = new Captcha; | ||
14 | $_SESSION['captcha'] = $captcha->getSolution(); // enregistrement de la réponse du captcha pour vérification | ||
15 | ?> | ||
16 | <!DOCTYPE html> | ||
17 | <html lang="fr"> | ||
18 | <head> | ||
19 | <meta charset="utf-8"> | ||
20 | <title>Bienvenue</title> | ||
21 | <link rel="icon" type="image/png" href="assets/favicon48x48.png"> | ||
22 | <link rel="stylesheet" href="css/body.css"> | ||
23 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
24 | </head> | ||
25 | <body> | ||
26 | <main> | ||
27 | <section> | ||
28 | <h3>Bienvenue.</h3> | ||
29 | <p style="text-align: center;">Veuillez choisir les codes que vous utiliserez pour gérer le site.</p> | ||
30 | <div class="login_form"> | ||
31 | <p style="color: red; font-style: italic;"><?= $error ?></p> | ||
32 | <form method="post" action="index.php?action=create_user" > | ||
33 | <p><label for="login" >Identifiant:</label> | ||
34 | <input id="login" type="text" name="login" autofocus required></p> | ||
35 | <p><label for="password" >Mot de passe:</label> | ||
36 | <input id="password" type="password" name="password" required></p> | ||
37 | <p><label for="password_confirmation" >Confirmer le mot de passe:</label> | ||
38 | <input id="password_confirmation" type="password" name="password_confirmation" required></p> | ||
39 | <input type="hidden" name="create_user_hidden"> | ||
40 | |||
41 | <p>Montrez que vous n'êtes pas un robot.<br> | ||
42 | <label for="captcha" >Combien font <?= $captcha->getA() ?> fois <?= $captcha->getB() ?>?</label> | ||
43 | <input required type="text" id="captcha" name="captcha" autocomplete="off" size="1"> | ||
44 | </p> | ||
45 | |||
46 | <input type="submit" value="Valider"> | ||
47 | </form> | ||
48 | </div> | ||
49 | </section> | ||
50 | </main> | ||
51 | </body> | ||
52 | </html> \ No newline at end of file | ||
diff --git a/src/view/templates/user_edit.php b/src/view/templates/user_edit.php new file mode 100644 index 0000000..b4b35ed --- /dev/null +++ b/src/view/templates/user_edit.php | |||
@@ -0,0 +1,62 @@ | |||
1 | <?php declare(strict_types=1); ?> | ||
2 | <section> | ||
3 | <div class="user_edit_header"> | ||
4 | <div class="empty_column"></div> | ||
5 | <h3 class="connexionTitre" >Mon compte</h3> | ||
6 | <div> | ||
7 | <img class="user_icon" src="assets/user_hollow.svg"> | ||
8 | <div><?= $_SESSION['user'] ?></div> | ||
9 | </div> | ||
10 | </div> | ||
11 | <div class="user_edit_flex"> | ||
12 | <div class="login_form"> | ||
13 | <p class="connexionP" >Modifier mon nom d'utilisateur.</p> | ||
14 | <p style="color: red; font-style: italic;"><?= $error_username ?></p> | ||
15 | <p style="color: green; font-style: italic;"><?= $success_username ?></p> | ||
16 | <form class="connexionFormulaire" method="post" action="<?= $link_user_form ?>" > | ||
17 | <p><label for="old_login" >Ancien nom:</label> | ||
18 | <input id="old_login" type="text" name="old_login" required></p> | ||
19 | <p><label for="password" >Mot de passe:</label> | ||
20 | <input id="password" type="password" name="password" required ></p> | ||
21 | <p><label for="new_login" >Nouveau nom:</label> | ||
22 | <input id="new_login" type="text" name="new_login" required></p> | ||
23 | <input type="hidden" name="modify_username_hidden"> | ||
24 | |||
25 | <p>Montrez que vous n'êtes pas un robot.<br> | ||
26 | <label for="captcha" >Combien font <?= $captcha->getA() ?> fois <?= $captcha->getB() ?>?</label> | ||
27 | <input required type="text" id="captcha" name="captcha" autocomplete="off" size="1"> | ||
28 | </p> | ||
29 | |||
30 | <input type="submit" value="Valider"> | ||
31 | </form> | ||
32 | </div> | ||
33 | <div class="login_form"> | ||
34 | <p class="connexionP" >Modifier mon mot de passe.</p> | ||
35 | <p style="color: red; font-style: italic;"><?= $error_password ?></p> | ||
36 | <p style="color: green; font-style: italic;"><?= $success_password ?></p> | ||
37 | <form class="connexionFormulaire" method="post" action="<?= $link_password_form ?>" > | ||
38 | <p><label for="login" >Nom:</label> | ||
39 | <input id="login" type="text" name="login" required></p> | ||
40 | <p><label for="old_password" >Ancien mot de passe:</label> | ||
41 | <input id="old_password" type="password" name="old_password" required ></p> | ||
42 | <p><label for="new_password" >Nouveau mot de passe:</label> | ||
43 | <input id="new_password" type="password" name="new_password" required autocomplete="off"></p> | ||
44 | <input type="hidden" name="modify_password_hidden"> | ||
45 | |||
46 | <p>Montrez que vous n'êtes pas un robot.<br> | ||
47 | <label for="captcha" >Combien font <?= $captcha->getA() ?> fois <?= $captcha->getB() ?>?</label> | ||
48 | <input required type="text" id="captcha" name="captcha" autocomplete="off" size="1"> | ||
49 | </p> | ||
50 | |||
51 | <input type="submit" value="Valider"> | ||
52 | </form> | ||
53 | </div> | ||
54 | </div> | ||
55 | <div class="login_form"> | ||
56 | <p class="connexionP connexionFooter" > | ||
57 | <a href="<?= $link_exit ?>" > | ||
58 | <button>Retour au site</button> | ||
59 | </a> | ||
60 | </p> | ||
61 | </div> | ||
62 | </section> \ No newline at end of file | ||