2019-09-06 11:48:50 +00:00
|
|
|
<?php
|
2019-09-07 11:42:36 +00:00
|
|
|
require_once "header.php";
|
|
|
|
|
|
|
|
if (isset($error_message) && $error_message)
|
2019-09-09 00:10:25 +00:00
|
|
|
echo "<div class=\"alert alert-danger\">Erreur : " . $error_message . "</div>";
|
2019-09-07 11:42:36 +00:00
|
|
|
|
2019-09-06 11:48:50 +00:00
|
|
|
if (isset($error_message) && $error_message === FALSE) {
|
2019-09-09 00:10:25 +00:00
|
|
|
if (isset($_GET["mdp_oublie"]))
|
|
|
|
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"]))
|
|
|
|
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"]))
|
|
|
|
echo "<div class=\"alert alert-success\">Le mail a bien été renvoyé.</div>";
|
|
|
|
else
|
|
|
|
echo "<div class=\"alert alert-success\">Connexion réussie !</div>";
|
|
|
|
} else if (isset($_SESSION["user_id"])) { ?>
|
|
|
|
<div class="alert alert-danger">Vous êtes déjà connecté !</div>
|
2019-09-06 11:48:50 +00:00
|
|
|
<?php } else { ?>
|
|
|
|
|
2019-09-09 00:10:25 +00:00
|
|
|
<?php if (isset($_GET["mdp_oublie"])) { ?>
|
|
|
|
<form method="POST" class="jumbotron mt-5">
|
|
|
|
<h1 class="display-4">Réinitialisation du mot de passe</h1>
|
|
|
|
<label for="email">E-mail associée au compte :</label>
|
|
|
|
<input type="email" class="form-control" id="email" name="email"/>
|
|
|
|
</div>
|
|
|
|
<input class="btn btn-lg btn-primary" type="submit" name="forgotten_password"
|
|
|
|
value="Envoyer l'e-mail de récupération"/>
|
|
|
|
</form>
|
|
|
|
<?php } elseif (isset($_GET["reset_password"])) { ?>
|
|
|
|
<form method="POST" class="jumbotron mt-5">
|
|
|
|
<h1 class="display-4">Connexion</h1>
|
|
|
|
<input type="hidden" name="token" value="<?= $_GET["token"] ?>"/>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="password">Nouveau mot de passe :</label>
|
|
|
|
<input type="password" id="password" name="password" class="form-control" />
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="confirm_password">Confirmer le mot de passe :</label>
|
|
|
|
<input type="password" id="confirm_password" name="confirm_password" class="form-control" />
|
|
|
|
</div>
|
|
|
|
<input type="submit" name="reset_password" class="btn btn-block btn-primary"
|
|
|
|
value="Changer le mot de passe"/>
|
|
|
|
</form>
|
|
|
|
<?php } elseif (isset($_GET["confirmation-mail"])) { ?>
|
|
|
|
<?php } else { ?>
|
|
|
|
<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"/>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="email">E-mail :</label>
|
|
|
|
<input class="form-control" type="email" id="email" name="email"
|
|
|
|
value="<?php if (isset($email)) echo $email ?>"/>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="password">Mot de passe :</label>
|
|
|
|
<input class="form-control" type="password" id="password" name="password"/>
|
|
|
|
</div>
|
|
|
|
<input class="btn btn-primary btn-block" type="submit" value="Se connecter"/>
|
|
|
|
</form>
|
|
|
|
<div class="alert">
|
|
|
|
<a href="/connexion/mdp_oublie">Mot de passe oublié ?</a>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
2019-09-07 11:42:36 +00:00
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php require_once "footer.php" ?>
|