Mozilla/mozilla/webtools/addons/public/htdocs/recoverpassword.php
shaver%mozilla.org e451a2b2d7 Beating some things with the rustico stick. Huzzah.
git-svn-id: svn://10.0.0.236/trunk@214061 18797224-902f-48f8-a5cc-f745e15eee43
2006-10-24 09:59:24 +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, 'rustico');
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
)
);
?>