C:\$Recycle.Bin\S-1-5-21-3967099092-2644009230-141905953-500\$R24B99I\web\password.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?
$nocheck
=TRUE;
require(
"inc/menu.php");
require(
"inc/html.php");
require(
"inc/common.php");
require(
"inc/password.php");

$config=getconfig();

$output="";

if (isset(
$_POST["email"])) {
    
$result=doquery("select id from user where email = \"".greatescape($_POST["email"])."\"");
    if (
mysql_num_rows($result)==0) {
        
$output.="Email address not found, sorry.";
    } else {
        
$row=mysql_fetch_assoc($result);

        
$pass=genpass();

        
doquery("update user set password=\"".md5($pass)."\" where id = ".$row["id"]);

        
$to=$_POST["email"];
        
$subject=$config["sitename"]." password";
        
$message="Someone, possibly you, has requested a new password for your MovieDB database login.\n\n";
        
$message.="Your new password is \"".$pass."\". Please proceed to ".$config["home"].", log in and change your password from the Edit user page.";
        
$headers="From: ".$config["siteemail"];

        
mail($to,$subject,$message,$headers);
        
$output.="Your new password has been emailed!";
    }
} else {
    
$output.="If you've lost your password, enter your email address below, and a new password will be generated and emailed to you.\n<P>\n";
    
$output.=form_begin("password.php","POST");
    
$output.="Email address: ".input_text("email",30,255)."<BR /><BR />\n";
    
$output.=submit("Generate new password");
    
$output.=form_end();
}

$content["body"] =& $output;
dopage($content);

?>