summaryrefslogtreecommitdiff
path: root/src/view/templates/user_create.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/templates/user_create.php')
-rw-r--r--src/view/templates/user_create.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/view/templates/user_create.php b/src/view/templates/user_create.php
new file mode 100644
index 0000000..68e115c
--- /dev/null
+++ b/src/view/templates/user_create.php
@@ -0,0 +1,53 @@
1<?php
2declare(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 'bad_login_or_password' => 'Mauvais identifiant ou mot de passe, veuillez réessayer.',
9 'different_passwords' => 'Les deux mots de passe saisis sont différents',
10 'forbidden_characters' => 'Caractères interdits: espaces, tabulations, sauts CR/LF.'
11];
12$error = isset($_GET['error']) ? $error_messages[$_GET['error']] : '';
13
14$captcha = new Captcha;
15$_SESSION['captcha'] = $captcha->getSolution(); // enregistrement de la réponse du captcha pour vérification
16?>
17<!DOCTYPE html>
18<html lang="fr">
19 <head>
20 <meta charset="utf-8">
21 <title>Bienvenue</title>
22 <link rel="icon" type="image/png" href="assets/favicon48x48.png">
23 <link rel="stylesheet" href="css/body.css">
24 <meta name="viewport" content="width=device-width, initial-scale=1.0">
25 </head>
26 <body>
27 <main>
28 <section>
29 <h3>Bienvenue.</h3>
30 <p style="text-align: center;">Veuillez choisir les codes que vous utiliserez pour gérer le site.</p>
31 <div class="login_form">
32 <p style="color: red; font-style: italic;"><?= $error ?></p>
33 <form method="post" action="index.php?action=create_user" >
34 <p><label for="login" >Identifiant:</label>
35 <input id="login" type="text" name="login" autofocus required></p>
36 <p><label for="password" >Mot de passe:</label>
37 <input id="password" type="password" name="password" required></p>
38 <p><label for="password_confirmation" >Confirmer le mot de passe:</label>
39 <input id="password_confirmation" type="password" name="password_confirmation" required></p>
40 <input type="hidden" name="create_user_hidden">
41
42 <p>Montrez que vous n'êtes pas un robot.<br>
43 <label for="captcha" >Combien font <?= $captcha->getA() ?> fois <?= $captcha->getB() ?>?</label>
44 <input required type="text" id="captcha" name="captcha" autocomplete="off" size="1">
45 </p>
46
47 <input type="submit" value="Valider">
48 </form>
49 </div>
50 </section>
51 </main>
52 </body>
53</html> \ No newline at end of file