3 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
5 include_once("aur.inc.php"); # access AUR common functions
7 if (isset($_COOKIE["AURSID"])) {
14 if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confirm'])) {
15 $resetkey = $_GET['resetkey'];
16 $email = $_POST['email'];
17 $password = $_POST['password'];
18 $confirm = $_POST['confirm'];
19 $uid = uid_from_email($email);
21 if (empty($email) ||
empty($password)) {
22 $error = __('Missing a required field.');
23 } elseif ($password != $confirm) {
24 $error = __('Password fields do not match.');
25 } elseif (!good_passwd($password)) {
26 $length_min = config_get_int('options', 'passwd_min_len');
27 $error = __("Your password must be at least %s characters.",
29 } elseif ($uid == null) {
30 $error = __('Invalid e-mail.');
34 $error = password_reset($password, $resetkey, $email);
36 } elseif (isset($_POST['email'])) {
37 $email = $_POST['email'];
38 $username = username_from_id(uid_from_email($email));
41 $error = __('Missing a required field.');
43 send_resetkey($email);
44 header('Location: ' . get_uri('/passreset/') . '?step=confirm');
49 $step = isset($_GET['step']) ?
$_GET['step'] : NULL;
51 html_header(__("Password Reset"));
56 <h2
><?
= __("Password Reset"); ?
></h2
>
58 <?php
if ($step == 'confirm'): ?
>
59 <p
><?
= __('Check your e-mail for the confirmation link.') ?
></p
>
60 <?php
elseif ($step == 'complete'): ?
>
61 <p
><?
= __('Your password has been reset successfully.') ?
></p
>
62 <?php
elseif (isset($_GET['resetkey'])): ?
>
64 <ul
class="errorlist"><li
><?
= $error ?
></li
></ul
>
66 <form action
="" method
="post">
69 <td
><?
= __("Confirm your e-mail address:"); ?
></td
>
70 <td
><input type
="text" name
="email" size
="30" maxlength
="64" /></td
>
73 <td
><?
= __("Enter your new password:"); ?
></td
>
74 <td
><input type
="password" name
="password" size
="30" /></td
>
77 <td
><?
= __("Confirm your new password:"); ?
></td
>
78 <td
><input type
="password" name
="confirm" size
="30" /></td
>
82 <input type
="submit" class="button" value
="<?= __('Continue') ?>" />
85 <p
><?
= __('If you have forgotten the e-mail address you used to register, please send a message to the %saur-general%s mailing list.',
86 '<a href="https://mailman.archlinux.org/mailman/listinfo/aur-general">',
89 <ul
class="errorlist"><li
><?
= $error ?
></li
></ul
>
91 <form action
="" method
="post">
92 <p
><?
= __("Enter your e-mail address:"); ?
>
93 <input type
="text" name
="email" size
="30" maxlength
="64" /></p
>
94 <input type
="submit" class="button" value
="<?= __('Continue') ?>" />
101 html_footer(AURWEB_VERSION
);