passreset.php: Refactor HTML

* Use the "errorlist" class for errors.
* Refactor some code.
* Properly display error messages when requesting a key.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-01-08 16:06:15 +01:00
parent 72e4d54178
commit 48b74071f0

View file

@ -56,16 +56,14 @@ html_header(__("Password Reset"));
<div class="box"> <div class="box">
<h2><?= __("Password Reset"); ?></h2> <h2><?= __("Password Reset"); ?></h2>
<?php if ($step == 'confirm'): ?>
<p>Check your e-mail for the confirmation link.</p>
<?php elseif ($step == 'complete'): ?>
<p>Your password has been reset successfully.</p>
<?php elseif (isset($_GET['resetkey'])): ?>
<?php if ($error): ?> <?php if ($error): ?>
<p><span class="error"><?= $error ?></span></p> <ul class="errorlist"><li><?= $error ?></li></ul>
<?php endif; ?> <?php endif; ?>
<?php
if ($step == 'confirm') {
echo __('Check your e-mail for the confirmation link.');
} elseif ($step == 'complete') {
echo __('Your password has been reset successfully.');
} elseif (isset($_GET['resetkey'])) {
?>
<form action="" method="post"> <form action="" method="post">
<table> <table>
<tr> <tr>
@ -84,18 +82,19 @@ html_header(__("Password Reset"));
<br /> <br />
<input type="submit" class="button" value="<?= __('Continue') ?>" /> <input type="submit" class="button" value="<?= __('Continue') ?>" />
</form> </form>
<?php <?php else: ?>
} else {
?>
<p><?= __('If you have forgotten the e-mail address you used to register, please send a message to the %saur-general%s mailing list.', <p><?= __('If you have forgotten the e-mail address you used to register, please send a message to the %saur-general%s mailing list.',
'<a href="https://mailman.archlinux.org/mailman/listinfo/aur-general">', '<a href="https://mailman.archlinux.org/mailman/listinfo/aur-general">',
'</a>'); ?></p> '</a>'); ?></p>
<?php if ($error): ?>
<ul class="errorlist"><li><?= $error ?></li></ul>
<?php endif; ?>
<form action="" method="post"> <form action="" method="post">
<p><?= __("Enter your e-mail address:"); ?> <p><?= __("Enter your e-mail address:"); ?>
<input type="text" name="email" size="30" maxlength="64" /></p> <input type="text" name="email" size="30" maxlength="64" /></p>
<input type="submit" class="button" value="<?= __('Continue') ?>" /> <input type="submit" class="button" value="<?= __('Continue') ?>" />
</form> </form>
<?php } ?> <?php endif; ?>
</div> </div>
<?php <?php