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.php52
1 files changed, 52 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..dd17547
--- /dev/null
+++ b/src/view/templates/user_create.php
@@ -0,0 +1,52 @@
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 '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