|
|
|
@ -30,13 +30,13 @@ global $_configuration; |
|
|
|
|
|
|
|
|
|
if (CustomPages::enabled()) { |
|
|
|
|
//Reset Password when user goes to the link |
|
|
|
|
if ($_GET['reset'] && $_GET['id']){ |
|
|
|
|
if ($_GET['reset'] && $_GET['id']) { |
|
|
|
|
$mesg = Login::reset_password($_GET["reset"], $_GET["id"], true); |
|
|
|
|
CustomPages::display(CustomPages::INDEX_UNLOGGED, array('info' => $mesg)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Check email/username and do the right thing |
|
|
|
|
if (isset ($_POST['user']) && isset ($_POST['email'])) { |
|
|
|
|
if (isset($_POST['user']) && isset ($_POST['email'])) { |
|
|
|
|
$user = $_POST['user']; |
|
|
|
|
$email = $_POST['email']; |
|
|
|
|
|
|
|
|
@ -57,16 +57,18 @@ if (CustomPages::enabled()) { |
|
|
|
|
|
|
|
|
|
if ($result && $num_rows > 0) { |
|
|
|
|
if ($num_rows > 1) { |
|
|
|
|
$by_username = false; // more than one user |
|
|
|
|
// more than one user |
|
|
|
|
$by_username = false; |
|
|
|
|
while ($data = Database::fetch_array($result)) { |
|
|
|
|
$user[] = $data; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$by_username = true; // single user (valid user + email) |
|
|
|
|
// single user (valid user + email) |
|
|
|
|
$by_username = true; |
|
|
|
|
$user = Database::fetch_array($result); |
|
|
|
|
} |
|
|
|
|
if ($_configuration['password_encryption'] != 'none') { |
|
|
|
|
//Send email with secret link to user |
|
|
|
|
// Send email with secret link to user |
|
|
|
|
Login::handle_encrypted_password($user, $by_username); |
|
|
|
|
} else { |
|
|
|
|
Login::send_password_to_user($user, $by_username); |
|
|
|
@ -75,9 +77,12 @@ if (CustomPages::enabled()) { |
|
|
|
|
CustomPages::display(CustomPages::LOST_PASSWORD, array('error' => get_lang('NoUserAccountWithThisEmailAddress'))); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
CustomPages::display(CustomPages::LOGGED_OUT); |
|
|
|
|
CustomPages::display(CustomPages::LOST_PASSWORD); |
|
|
|
|
} |
|
|
|
|
CustomPages::display(CustomPages::INDEX_UNLOGGED, array('info' => get_lang('YourPasswordHasBeenEmailed'))); |
|
|
|
|
CustomPages::display( |
|
|
|
|
CustomPages::INDEX_UNLOGGED, |
|
|
|
|
array('info' => get_lang('YourPasswordHasBeenEmailed')) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$tool_name = get_lang('LostPassword'); |
|
|
|
|