Lost Password Bug Fix
Date: Friday, January 09 @ 11:02:50 CET
Topic: Bug Fixes


I just noticed a bug in the "Lost Password" functionality of the Your Account module. If a user entered an invalid username, it would still say "Confirmation code mailed" even if the user didn't exist in the database, instead of saying "Invalid User". To fix, read more...

Open Your_Account/index.php.
find the mail_password function (on/around line 638).
The fourth line reads:

if(!$result) {

BUT the problem is that a result resource will always be returned even if it has no actual results contained within it. to fix, change the line to:

if(sql_num_rows($result) == 0) {

That's it. No more bounced emails :)

Nice & thanks!



This article comes from NukeCops
http://www.nukecops.com

The URL for this story is:
http://www.nukecops.com/modules.php?name=News&file=article&sid=1352