I have a user registration form , in this form i am taking entry for name, email and password from user. I have buttons save
and reset password
.
save button save data in database.
now in reset password button I have to reset the password and lock the user. How can I do it.
previously with this email and password user can entry in the system now after resetting password I have to lock this user. How, please suggest.
Asked
Active
Viewed 138 times
0

Romi
- 4,833
- 28
- 81
- 113
-
best way to lock the user from database fileds what @BalusC has told. and if youare looking how http://stackoverflow.com/questions/1471654/reversing-an-md5-hash/13000731#13000731 – Rafee Oct 21 '12 at 18:27
1 Answers
1
Add a column active
to the DB which you set with a boolean or bit value, e.g. 0
or 1
. If the user has registered and activated the account, set it to 1
. If you want to lock the user, set it to 0
.
On every incoming request with a logged-in user, you just check the active
column associated with the ID of the logged-in user. If it's 0
, then invalidate the session and redirect to the activation form.
Note: you normally use a servlet or, in this case better, a filter for this, not JSP/JSTL.