💄 Ajout de jolis formulaires d'inscription
Signed-off-by: Hadrien RENAUD <hadrien.renaud@polytechnique.edu>
This commit is contained in:
parent
49a2fbe83e
commit
8eef72b104
|
@ -2,95 +2,65 @@
|
||||||
require_once "header.php";
|
require_once "header.php";
|
||||||
|
|
||||||
if (isset($error_message) && $error_message)
|
if (isset($error_message) && $error_message)
|
||||||
echo "<h2>Erreur : " . $error_message . "</h2>";
|
echo "<div class=\"alert alert-danger\">Erreur : " . $error_message . "</div>";
|
||||||
|
|
||||||
if (isset($error_message) && $error_message === FALSE) {
|
if (isset($error_message) && $error_message === FALSE) {
|
||||||
if (isset($_GET["mdp_oublie"]))
|
if (isset($_GET["mdp_oublie"]))
|
||||||
echo "Le mail de récupération de mot de passe a bien été envoyé.";
|
echo "<div class=\"alert alert-success\">Le mail de récupération de mot de passe a bien été envoyé.</div>";
|
||||||
else if (isset($_POST["reset_password"]))
|
else if (isset($_POST["reset_password"]))
|
||||||
echo "Le mot de passe a bien été changé. Vous pouvez désormais vous connecter.";
|
echo "<div class=\"alert alert-success\">Le mot de passe a bien été changé. Vous pouvez désormais vous connecter.</div>";
|
||||||
else if (isset($_GET["confirmation-mail"]))
|
else if (isset($_GET["confirmation-mail"]))
|
||||||
echo "Le mail a bien été renvoyé.";
|
echo "<div class=\"alert alert-success\">Le mail a bien été renvoyé.</div>";
|
||||||
else
|
else
|
||||||
echo "Connexion réussie !";
|
echo "<div class=\"alert alert-success\">Connexion réussie !</div>";
|
||||||
}
|
} else if (isset($_SESSION["user_id"])) { ?>
|
||||||
else if (isset($_SESSION["user_id"])) { ?>
|
<div class="alert alert-danger">Vous êtes déjà connecté !</div>
|
||||||
<h2>Vous êtes déjà connecté !</h2>
|
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<?php if (isset($_GET["mdp_oublie"])) { ?>
|
<?php if (isset($_GET["mdp_oublie"])) { ?>
|
||||||
<form method="POST">
|
<form method="POST" class="jumbotron mt-5">
|
||||||
<table style="width: 100%;">
|
<h1 class="display-4">Réinitialisation du mot de passe</h1>
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 30%;">
|
|
||||||
<label for="email">E-mail associée au compte :</label>
|
<label for="email">E-mail associée au compte :</label>
|
||||||
</td>
|
<input type="email" class="form-control" id="email" name="email"/>
|
||||||
<td style="width: 70%;">
|
</div>
|
||||||
<input style="width: 100%;" type="email" id="email" name="email" />
|
<input class="btn btn-lg btn-primary" type="submit" name="forgotten_password"
|
||||||
</td>
|
value="Envoyer l'e-mail de récupération"/>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<input style="width: 100%;" type="submit" name="forgotten_password" value="Envoyer l'e-mail de récupération" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
<?php } elseif (isset($_GET["reset_password"])) { ?>
|
<?php } elseif (isset($_GET["reset_password"])) { ?>
|
||||||
<form method="POST">
|
<form method="POST" class="jumbotron mt-5">
|
||||||
|
<h1 class="display-4">Connexion</h1>
|
||||||
<input type="hidden" name="token" value="<?= $_GET["token"] ?>"/>
|
<input type="hidden" name="token" value="<?= $_GET["token"] ?>"/>
|
||||||
<table style="width: 100%;">
|
<div class="form-group">
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 30%;">
|
|
||||||
<label for="password">Nouveau mot de passe :</label>
|
<label for="password">Nouveau mot de passe :</label>
|
||||||
</td>
|
<input type="password" id="password" name="password" class="form-control" />
|
||||||
<td style="width: 70%;">
|
</div>
|
||||||
<input style="width: 100%;" type="password" id="password" name="password" />
|
<div class="form-group">
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="width: 30%;">
|
|
||||||
<label for="confirm_password">Confirmer le mot de passe :</label>
|
<label for="confirm_password">Confirmer le mot de passe :</label>
|
||||||
</td>
|
<input type="password" id="confirm_password" name="confirm_password" class="form-control" />
|
||||||
<td style="width: 70%;">
|
</div>
|
||||||
<input style="width: 100%;" type="password" id="confirm_password" name="confirm_password" />
|
<input type="submit" name="reset_password" class="btn btn-block btn-primary"
|
||||||
</td>
|
value="Changer le mot de passe"/>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<input style="width: 100%;" type="submit" name="reset_password" value="Changer le mot de passe" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
<?php } elseif (isset($_GET["confirmation-mail"])) { ?>
|
<?php } elseif (isset($_GET["confirmation-mail"])) { ?>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<form method="POST">
|
<form method="POST" class="jumbotron mt-5">
|
||||||
|
<h1 class="display-4">Connexion</h1>
|
||||||
|
<hr class="mt-2 mb-4"/>
|
||||||
<input type="hidden" name="submitted" value="true"/>
|
<input type="hidden" name="submitted" value="true"/>
|
||||||
<table style="width: 100%;">
|
<div class="form-group">
|
||||||
<tr>
|
<label for="email">E-mail :</label>
|
||||||
<td style="width: 30%;"><label for="email">E-mail :</label></td>
|
<input class="form-control" type="email" id="email" name="email"
|
||||||
<td style="width: 70%;"><input style="width: 100%;" type="email" id="email" name="email" value="<?php if (isset($email)) echo $email ?>" /></td>
|
value="<?php if (isset($email)) echo $email ?>"/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="form-group">
|
||||||
<td><label for="password">Mot de passe :</label></td>
|
<label for="password">Mot de passe :</label>
|
||||||
<td><input style="width: 100%;" type="password" id="password" name="password" /></td>
|
<input class="form-control" type="password" id="password" name="password"/>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<input class="btn btn-primary btn-block" type="submit" value="Se connecter"/>
|
||||||
<td colspan="2">
|
|
||||||
<!--suppress HtmlUnknownTarget -->
|
|
||||||
<a href="/connexion/mdp_oublie">Mot de passe oublié ?</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><input style="width: 100%;" type="submit" value="Se connecter" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
</form>
|
||||||
|
<div class="alert">
|
||||||
|
<a href="/connexion/mdp_oublie">Mot de passe oublié ?</a>
|
||||||
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue