Hm looks rather dirty-hacky to me, are you sure this is the only way to accomplish this functionality?
Why don't you test for an email and query the username according to that email and replace it with the username before you check if the credentials were wrong. Then you wouldn't need to crack the salt also.
However, it seems to do what it's made for. Appreciate your effort.
|