passreset.php: Error out if e-mail is empty

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

View file

@ -37,14 +37,19 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir
}
} elseif (isset($_POST['email'])) {
$email = $_POST['email'];
$body = __('A password reset request was submitted for the account '.
'associated with your e-mail address. If you wish to reset '.
'your password follow the link below, otherwise ignore '.
'this message and nothing will happen.').
send_resetkey($email, $body);
header('Location: ' . get_uri('/passreset/') . '?step=confirm');
exit();
if (empty($email)) {
$error = __('Missing a required field.');
} else {
$body = __('A password reset request was submitted for the account '.
'associated with your e-mail address. If you wish to reset '.
'your password follow the link below, otherwise ignore '.
'this message and nothing will happen.').
send_resetkey($email, $body);
header('Location: ' . get_uri('/passreset/') . '?step=confirm');
exit();
}
}
$step = isset($_GET['step']) ? $_GET['step'] : NULL;