Mozilla/mozilla/webtools/addons/public/htdocs/recoverpassword.php
bugzilla%micropipes.com e628fe45d0 fixed bugs 332825 and 332837
git-svn-id: svn://10.0.0.236/trunk@193668 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 06:15:03 +00:00

43 lines
1.0 KiB
PHP

<?php
/**
* Page to recover passwords for existing accounts
*
* @package amo
* @subpackage docs
*
*/
startProcessing('recoverpassword.tpl', null, null, 'nonav');
require_once 'includes.php';
$bad_input = false;
$success = false;
// Give us a default value if it exists
$email_value = array_key_exists('email', $_GET) ? $_GET['email'] : '';
if (array_key_exists('email', $_POST) && !empty($_POST['email'])) {
$user = user::getUserByEmail($_POST['email']);
if ($user === false) {
// bad email address
$bad_input = true;
} else {
$user->generateConfirmationCode();
$user->sendPasswordRecoveryEmail();
$success = true;
}
//override the get string
$email_value = $_POST['email'];
}
// Assign template variables.
$tpl->assign(
array( 'title' => 'Firefox Add-ons Password Recovery',
'currentTab' => null,
'email' => $email_value,
'bad_input' => $bad_input,
'success' => $success
)
);
?>