2004-10-17 08:40:53 +04:00
|
|
|
<?php
|
|
|
|
require"../core/config.php";
|
|
|
|
?>
|
2004-12-09 09:34:53 +03:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2004-10-17 08:40:53 +04:00
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
|
|
<TITLE>Mozilla Update :: Password Reset</TITLE>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
include"$page_header";
|
|
|
|
?>
|
|
|
|
<hr class="hide">
|
|
|
|
<div id="mBody">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if ($_POST["submit"]=="Reset My Password") {
|
|
|
|
echo"<h1>Resetting Your Password, Please Wait...</h1>\n";
|
|
|
|
//Gather and Filter Data from the Submission Form
|
2004-12-09 09:34:53 +03:00
|
|
|
$email = escape_string($_POST["email"]);
|
2004-10-17 08:40:53 +04:00
|
|
|
|
|
|
|
//Generate Confirmation Code
|
|
|
|
$confirmationcode = md5(mt_rand());
|
|
|
|
|
|
|
|
$newpassword = substr(md5(mt_rand()),0,14);
|
|
|
|
$password_plain = $newpassword;
|
|
|
|
$password = md5($newpassword);
|
|
|
|
|
2004-12-09 09:34:53 +03:00
|
|
|
$sql = "SELECT `UserEmail` FROM `userprofiles` WHERE `UserEmail`='$email' LIMIT 1";
|
|
|
|
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
2004-10-17 08:40:53 +04:00
|
|
|
if (mysql_num_rows($sql_result)=="1") {
|
2004-12-09 09:34:53 +03:00
|
|
|
$sql = "UPDATE `userprofiles` SET `UserPass`='$password' WHERE `UserEmail`='$email' LIMIT 1";
|
2004-10-17 08:40:53 +04:00
|
|
|
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
|
|
|
|
if ($sql_result) {
|
|
|
|
include"mail_newpassword.php";
|
|
|
|
echo"Your password has been reset successfully. An e-mail has been sent to you containing your new password..<br>\n";
|
|
|
|
echo"<br><br><a href=\"./index.php\">«« Login to Mozilla Update's Developer Control Panel »»</a>";
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
echo"An error was encountered when trying to reset your password, verify the e-mail you entered is correct and try again.<br>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
include"$page_footer";
|
|
|
|
echo"</body>\n</html>\n";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
2004-12-09 09:34:53 +03:00
|
|
|
<h2>Reset Your Password</h2>
|
2004-10-17 08:40:53 +04:00
|
|
|
<P>Forgot the password to your Mozilla Update account? No problem. Just put your e-mail address in the form below, and a new password will
|
|
|
|
be generated and e-mailed to the e-mail address you have on file.</P>
|
|
|
|
|
|
|
|
<form name="resetpassword" method="post" action="?post=resetpassword">
|
|
|
|
<table border=0 cellpadding=0 cellspacing=0 style="width: 50%; margin: auto;">
|
|
|
|
<tr>
|
2004-12-09 09:34:53 +03:00
|
|
|
<td style="height: 30px;">E-Mail Address:</td>
|
2004-10-17 08:40:53 +04:00
|
|
|
<td><input name="email" type="text" size=30></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td colspan=2 align=center><input name="submit" type="submit" value="Reset My Password"><input name="reset" type="reset" value="Clear Form"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</form>
|
2004-12-09 09:34:53 +03:00
|
|
|
|
|
|
|
</div>
|
2004-10-17 08:40:53 +04:00
|
|
|
<?php
|
|
|
|
include"$page_footer";
|
|
|
|
?>
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|