I want to add a “Forgot password” function to my User Login module, for that i have created password Recovery action and when user enter an email system will check whether the mail is exist or not and if its exist it will send mail to user. What i want to know is how to include users current password and username to that mail.
How can i do this ?
You don’t do this ever, ever, EVER, you send a password recovery hash, and add a token with a time to live to your DB, then send the hash via email to the user who lost their password. Do not store passwords in the clear, it violates the clients password security, and should your DB be compromised it would release the username and password combinations to your entire userbase.
Store passwords as:
Retreive passwords as: