Thanks for giving me the code to look for. What you have there is correct. However after testing the forgot password function further, I found that the email was being generated by this in member.php:
Quote:
if ( $ppaction == "forgot" ) {
if ( $do == "process" ) {
$resultb = ppmysql_query("SELECT username,userid,joindate FROM {$Globals['rp_db_prefix']}users WHERE email='$inemail'", $link);
$checkrows = mysql_num_rows($resultb);
if ($checkrows > 0) {
while( list( $dbuser, $dbuid, $joindate ) = mysql_fetch_row($resultb) ) {
$genpass = gen_password();
$newpass = md5($genpass);
$resulta = ppmysql_query("UPDATE {$Globals['rp_db_prefix']}users SET password='$newpass' WHERE userid=$dbuid", $link);
include("{$Globals['RP_PATH']}/languages/$rplang/emails.php");
$email_from = "From: {$Globals['adminemail']}";
$letter = $Globals['pp_lang']['epassres1'];
$subject = $Globals['pp_lang']['epasssub2'];
mail( $inemail, $subject, $letter, $email_from );
}
|
That code, as you can see, encrypts the password before it is sent in the email. So I changed the code from $genpass on down to:
Quote:
$genpass = gen_password();
$newpass = $genpass;
include("{$Globals['RP_PATH']}/languages/$rplang/emails.php");
$email_from = "From: {$Globals['adminemail']}";
$letter = $Globals['pp_lang']['epassres1'];
$subject = $Globals['pp_lang']['epasssub2'];
mail( $inemail, $subject, $letter, $email_from );
$newpass = md5($genpass);
$resulta = ppmysql_query("UPDATE {$Globals['rp_db_prefix']}users SET password='$newpass' WHERE userid=$dbuid", $link);
}
|
I sent the email with $newpass before it was encrypted and added to the user table. Now it seems to be working correctly. Do you see anything that making this change will harm that I may have overlooked?