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 (!good_passwd($password)) {
29 $length_min = config_get_int('options', 'passwd_min_len');
30 $error = __("Your password must be at least %s characters.",
32 } elseif ($uid == null) {
33 $error = __('Invalid e-mail.');
37 $salt = generate_salt();
38 $hash = salted_hash($password, $salt);
40 $error = password_reset($hash, $salt, $resetkey, $email);
42 } elseif (isset($_POST['email'])) {
43 $email = $_POST['email'];
44 $username = username_from_id(uid_from_email($email));
47 $error = __('Missing a required field.');
49 send_resetkey($email);
50 header('Location: ' . get_uri('/passreset/') . '?step=confirm');
55 $step = isset($_GET['step']) ?
$_GET['step'] : NULL;
57 html_header(__("Password Reset"));
62 <h2
><?
= __("Password Reset"); ?
></h2
>
64 <?php
if ($step == 'confirm'): ?
>
65 <p
><?
= __('Check your e-mail for the confirmation link.') ?
></p
>
66 <?php
elseif ($step == 'complete'): ?
>
67 <p
><?
= __('Your password has been reset successfully.') ?
></p
>
68 <?php
elseif (isset($_GET['resetkey'])): ?
>
70 <ul
class="errorlist"><li
><?
= $error ?
></li
></ul
>
72 <form action
="" method
="post">
75 <td
><?
= __("Confirm your e-mail address:"); ?
></td
>
76 <td
><input type
="text" name
="email" size
="30" maxlength
="64" /></td
>
79 <td
><?
= __("Enter your new password:"); ?
></td
>
80 <td
><input type
="password" name
="password" size
="30" /></td
>
83 <td
><?
= __("Confirm your new password:"); ?
></td
>
84 <td
><input type
="password" name
="confirm" size
="30" /></td
>
88 <input type
="submit" class="button" value
="<?= __('Continue') ?>" />
91 <p
><?
= __('If you have forgotten the e-mail address you used to register, please send a message to the %saur-general%s mailing list.',
92 '<a href="https://mailman.archlinux.org/mailman/listinfo/aur-general">',
95 <ul
class="errorlist"><li
><?
= $error ?
></li
></ul
>
97 <form action
="" method
="post">
98 <p
><?
= __("Enter your e-mail address:"); ?
>
99 <input type
="text" name
="email" size
="30" maxlength
="64" /></p
>
100 <input type
="submit" class="button" value
="<?= __('Continue') ?>" />
107 html_footer(AURWEB_VERSION
);