3 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
5 include_once("aur.inc.php"); # access AUR common functions
7 set_lang(); # this sets up the visitor's language
8 check_sid(); # see if they're still logged in
10 if (isset($_COOKIE["AURSID"])) {
11 header('Location: /');
17 if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confirm'])) {
18 $resetkey = $_GET['resetkey'];
19 $email = $_POST['email'];
20 $password = $_POST['password'];
21 $confirm = $_POST['confirm'];
22 $uid = uid_from_email($email);
24 if (empty($email) ||
empty($password)) {
25 $error = __('Missing a required field.');
26 } elseif ($password != $confirm) {
27 $error = __('Password fields do not match.');
28 } elseif ($uid == NULL ||
$uid == 'None') {
29 $error = __('Invalid e-mail.');
33 $salt = generate_salt();
34 $hash = salted_hash($password, $salt);
36 $error = password_reset($hash, $salt, $resetkey, $email);
38 } elseif (isset($_POST['email'])) {
39 $email = $_POST['email'];
40 $body = __('A password reset request was submitted for the account '.
41 'associated with your e-mail address. If you wish to reset '.
42 'your password follow the link below, otherwise ignore '.
43 'this message and nothing will happen.').
44 send_resetkey($email, $body);
46 header('Location: ' . get_uri('/passreset/') . '?step=confirm');
50 $step = isset($_GET['step']) ?
$_GET['step'] : NULL;
52 html_header(__("Password Reset"));
57 <h2
><?
= __("Password Reset"); ?
></h2
>
60 <p
><span
class="error"><?
= $error ?
></span
></p
>
63 if ($step == 'confirm') {
64 echo __('Check your e-mail for the confirmation link.');
65 } elseif ($step == 'complete') {
66 echo __('Your password has been reset successfully.');
67 } elseif (isset($_GET['resetkey'])) {
69 <form action
="" method
="post">
72 <td
><?
= __("Confirm your e-mail address:"); ?
></td
>
73 <td
><input type
="text" name
="email" size
="30" maxlength
="64" /></td
>
76 <td
><?
= __("Enter your new password:"); ?
></td
>
77 <td
><input type
="password" name
="password" size
="30" /></td
>
80 <td
><?
= __("Confirm your new password:"); ?
></td
>
81 <td
><input type
="password" name
="confirm" size
="30" /></td
>
85 <input type
="submit" class="button" value
="<?= __('Continue') ?>" />
90 <p
><?
= __('If you have forgotten the e-mail address you used to register, please send a message to the %saur-general%s mailing list.',
91 '<a href="https://mailman.archlinux.org/mailman/listinfo/aur-general">',
93 <form action
="" method
="post">
94 <p
><?
= __("Enter your e-mail address:"); ?
>
95 <input type
="text" name
="email" size
="30" maxlength
="64" /></p
>
96 <input type
="submit" class="button" value
="<?= __('Continue') ?>" />
103 html_footer(AUR_VERSION
);