#
itamar82
How should I go about implementing a user registration confirmation workflow? What this means that when a user registers for the first time, an email is sent to them with a link to a page where their account will be confirmed. Attempts to log in as the user prior to confirmation will fail.
The way i was thinking of doing this is as follows:
Add a 'confirmed' column to the users table as a bit.
Create a user confirmation database table mapping between the user Id to a random generated confirmation code. (guid?)
When a new user is registered, create the mapping in the table and set the confirmed column to false.
Send an email with the link containing the confirmation code and user id to the user. When the user opens that link the service will first check if that user is already confirmed and if not, will check to see if the confirmation code matches the one in the database. If yes, delete the mapping and set the confirmed column of the user to true. Otherwise send the user to a page notifying them that confirmation failed.
What else should I keep on mind while doing this? This will be my first venture into modifying the core. Any advise will be appreciated.
The way i was thinking of doing this is as follows:
Add a 'confirmed' column to the users table as a bit.
Create a user confirmation database table mapping between the user Id to a random generated confirmation code. (guid?)
When a new user is registered, create the mapping in the table and set the confirmed column to false.
Send an email with the link containing the confirmation code and user id to the user. When the user opens that link the service will first check if that user is already confirmed and if not, will check to see if the confirmation code matches the one in the database. If yes, delete the mapping and set the confirmed column of the user to true. Otherwise send the user to a page notifying them that confirmation failed.
What else should I keep on mind while doing this? This will be my first venture into modifying the core. Any advise will be appreciated.