aboutsummaryrefslogtreecommitdiff
path: root/src/View/templates/user_create.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-10-23 00:47:32 +0200
committerpolo <ordipolo@gmx.fr>2026-10-23 00:47:32 +0200
commitf27cca08ff786ceff1870147f6d6bad14d71117f (patch)
treed36597a72025313d6faf4ed228755fa267ebe2f6 /src/View/templates/user_create.php
parentc7309f900ef05bd5cb313110ec159b761af394ec (diff)
downloadcms-f27cca08ff786ceff1870147f6d6bad14d71117f.tar.gz
cms-f27cca08ff786ceff1870147f6d6bad14d71117f.tar.bz2
cms-f27cca08ff786ceff1870147f6d6bad14d71117f.zip
dossiers avec majuscule, namespace pour toutes les classes, autoload psr-4, UserDataService::createZip déplacé dans Backup
Diffstat (limited to 'src/View/templates/user_create.php')
-rw-r--r--src/View/templates/user_create.php54
1 files changed, 54 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..662d9ac
--- /dev/null
+++ b/src/View/templates/user_create.php
@@ -0,0 +1,54 @@
1<?php
2declare(strict_types=1);
3use App\Service\Captcha;
4
5$error_messages = [
6 'error_non_valid_captcha' => 'Erreur au test anti-robot, veuillez saisir un nombre entier.',
7 'captcha_server_error' => 'captcha_server_error',
8 'bad_solution_captcha' => 'Erreur au test anti-robot, veuillez réessayer.',
9 'bad_login_or_password' => 'Mauvais identifiant ou mot de passe, veuillez réessayer.',
10 'different_passwords' => 'Les deux mots de passe saisis sont différents',
11 'forbidden_characters' => 'Caractères interdits: espaces, tabulations, sauts CR/LF.'
12];
13$error = isset($_GET['error']) ? $error_messages[$_GET['error']] : '';
14
15$captcha = new Captcha;
16$_SESSION['captcha'] = $captcha->getSolution(); // enregistrement de la réponse du captcha pour vérification
17?>
18<!DOCTYPE html>
19<html lang="fr">
20 <head>
21 <meta charset="utf-8">
22 <title>Bienvenue</title>
23 <link rel="icon" type="image/png" href="assets/favicon48x48.png">
24 <link rel="stylesheet" href="css/body.css">
25 <meta name="viewport" content="width=device-width, initial-scale=1.0">
26 </head>
27 <body>
28 <main>
29 <section>
30 <h3>Bienvenue.</h3>
31 <p style="text-align: center;">Pour commencer, veuillez créer un compte administrateur.</p>
32 <div class="basic_div">
33 <p style="color: red; font-style: italic;"><?= $error ?></p>
34 <form method="post" action="index.php?action=create_user" >
35 <p><label for="login" >Identifiant:</label>
36 <input id="login" type="text" name="login" autofocus required></p>
37 <p><label for="password" >Mot de passe:</label>
38 <input id="password" type="password" name="password" required></p>
39 <p><label for="password_confirmation" >Confirmer le mot de passe:</label>
40 <input id="password_confirmation" type="password" name="password_confirmation" required></p>
41 <input type="hidden" name="create_user_hidden">
42
43 <p>Montrez que vous n'êtes pas un robot.<br>
44 <label for="captcha" >Combien font <?= $captcha->getA() ?> fois <?= $captcha->getB() ?>?</label>
45 <input required type="text" id="captcha" name="captcha" autocomplete="off" size="1">
46 </p>
47
48 <input type="submit" value="Valider">
49 </form>
50 </div>
51 </section>
52 </main>
53 </body>
54</html> \ No newline at end of file