<h2><?php echo __('Mot de passe oublié'); ?></h2>
<?php include(__DIR__ . '/report.tpl.php'); ?>
<div id="connection_fields">
<?php if ($tpl['forgot_password']['step'] == 'confirm') : ?>
	<div class="report_classic">
		<div class="report_msg report_success">
			<p><?php echo $tpl['forgot_password']['text']; ?></p>
		</div>
	</div>
<?php else : ?>
	<p id="connection_text" class="field"><?php echo $tpl['forgot_password']['text']; ?></p>
	<p class="field">
		<label for="f_email">Email :</label>
		<input maxlength="255" id="f_email" name="f_email" type="text">
	</p>
<?php if ($tpl['forgot_password']['step'] == 'forgot') : ?>
	<p class="field">
		<label for="login"><?php echo __('Nom d\'utilisateur :'); ?></label>
		<input required autofocus value="<?php echo $_POST['login'] ?? ''; ?>" size="40" maxlength="<?php echo $tpl['profile_params']['login']['maxlength']; ?>" type="text" id="login" name="login" class="large">
	</p>
	<p class="field">
		<label for="email"><?php echo __('Adresse de courriel :'); ?></label>
		<input required value="<?php echo $_POST['email'] ?? ''; ?>" size="40" maxlength="<?php echo $tpl['profile_params']['email']['maxlength']; ?>" type="email" id="email" name="email" class="large">
	</p>
	<input type="submit" value="<?php echo __('Envoyer'); ?>">
<?php elseif ($tpl['forgot_password']['step'] == 'reset') : ?>
	<p class="field">
		<label for="code"><?php echo __('Code :'); ?></label>
		<input required autofocus size="40" maxlength="50" type="text" id="code" name="code" class="large">
	</p>
	<p class="field">
		<label for="password"><?php printf(__('Mot de passe (%s caractères minimum) :'), $tpl['profile_params']['password']['minlength']); ?></label>
		<input data-password-view="1" required id="password" name="password" type="password" maxlength="<?php echo $tpl['profile_params']['password']['maxlength']; ?>" class="large">
	</p>
	<p class="field">
		<label for="password_confirm"><?php echo __('Confirmez le mot de passe :'); ?></label>
		<input data-password-view="1" required id="password_confirm" name="password_confirm" type="password" maxlength="<?php echo $tpl['profile_params']['password']['maxlength']; ?>" class="large">
	</p>
	<input name="login" type="hidden" value="<?php echo $tpl['forgot_password']['login'] ?? ''; ?>">
	<input type="submit" value="<?php echo __('Valider'); ?>">
<?php endif; ?>
	<input name="step" type="hidden" value="<?php echo $tpl['forgot_password']['step']; ?>">
	<input name="anticsrf" type="hidden" value="<?php echo $tpl['anticsrf'](); ?>">
<?php endif; ?>
</div>
<br>
<p class="field" id="connection_link">
	<a href="<?php echo $tpl['link']('login'); ?>"><?php echo __('Retour'); ?></a>
</p>