You can download the project here:
All of the code to accomplish your login / account locking / forgot password XXXXX been implemented.
This functionality uses SMTP to send emails. Now, when you run this kind of a project locally, the email will not send out. That is because your local computer is not an SMTP server. If you were to publish the web site to an actual web server, it would work just fine. But attempting to test locally prevents you from seeing the emails.
There is, however, an excellent way to test the email functionality. Go here
and download the Test Mail Server Tool.
Once you download it, go ahead and install it. Once it is installed, run it. Do not change any of the settings. Just let it run in the background.
What this tool does is it listens for attempts to send out email messages. Usually, when you run a development program on your computer locally for testing purposes, the program will attempt to send out an email message. Because you have no email server running, the message simply dies and/or throws an error in the application stating that it could not connect to an SMTP server.
With this tool, those messages are intercepted and the email is opened up on your computer automatically in your system's default email program (e.g., Outlook, Windows Live Mail).
It is an excellent tool and you definitely want to run it.
Now for the functionality:
Attempt to log on as username tester
This will let you know that your login is incorrect. Attempt again. Now again. At this point, the test mail server tool will pull up an email telling you that your account has been locked. It will also give you a special code for unlocking your account.
No go back to the login page and try to log in again with the bad login information. Notice that it now tells you that your account has been locked.
As well as tell you that your account has been locked, a new link is displayed for unlocking your account. Click on the link.
On this page, enter some random information into the form fields. Notice that it tells you that it is not valid unlock information. Now, but in tester
and the code from the email message.
When you put in the correct code, you are redirected back to the login page.
Now, assume that you do not know what the correct password XXXXX tester
is. Try clicking on "Forgot Password". If you didn't put anything into the form, it will ask you to enter a username. Enter your username tester
and click on "Forgot Password" again.
This time, a new email message is displayed. This email message is sent to the email of the client account. It tells you what the correct password XXXXX: test
Now, log on with tester
This sets a session variable and directs you to the items page, which appears to not currently have anything on it.
But that's it for the log in. All of the functionality that you requested has been accomplished.
I wanted to further demonstrate the functionality to you, in case my description was not clear enough. I also wanted you to see that it is fully functional. You can view a screencast of the working project here:http://www.screencast.com/t/tEP8ksjVL
As you can see, it all works and works well. Make sure you get that test mail server tool. It is extremely useful for all kinds of development work (.NET, PHP, JSP, Ruby on Rails, etc.).
Let me know if you have any questions at all. I'm here to help.
If you ever require assistance in the future with anything development or database related, please feel free to request me directly by starting your questions with **For TheDoctor**. It would be my pleasure to assist you again.
Please remember to rate my answer. It is greatly appreciated. Thank you so much and have a wonderful day!