Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

User Email Activation

0 views
Skip to first unread message

briz26

unread,
Jul 10, 2007, 6:15:07 PM7/10/07
to
Hi All,

Any thoughts/recommendation on scripts or documentation on implementing a email account activation after a user creates an account. Anything BESIDES the developer toolkit?

Thanks,
Mike

jdeline

unread,
Jul 11, 2007, 5:11:39 AM7/11/07
to
At the highest level, you need to have a database that has the user ID and
password in a table. A user would be faced with the first page that says
"Login" and is provided with input text fields for user ID and password. The
action page should query the database using these two fields in the WHERE
clause. If the query record count is zero, the user is not recognized and the
appropriate logic can be invoked. Otherwise, continue with the known user
logic.

c_wigginton

unread,
Jul 11, 2007, 11:43:34 AM7/11/07
to
Generate a unique activation key

<cfset activateKey = CreateUUID()>

Create a column in the user database table to store the key. Create an
additional boolean column for activated.

Save the key as part of saving the user email information and default the
activated to false.

Then just send an email and build an href back to an activation template.

<cfmail to="some...@somesite.com" from="activa...@somesite.com"
type="HTML">
Please click the link to activate your email
<a href="http://somesite.com/activate.cfm?activateKey=#activateKey#>
</cfmail>

You should also consider using <cfmailpart> for supplying a text only
activation section for those users that have mail readers that don't support
HTML, as well as instructions for copying and pasting the url into a browser.

In systems I've implemented in the past, I like to store the date of
activation for retiring old emails or sending out reminder notices such as

<cfquery datasource="someDSN">
update users
set activate = 1,
active_date = <cfqueryparam cfsqltype="cf_sql_date" value="#now()#">
where activateKey = <cfqueryparam cfsqltype="cf_sql_varchar" maxlength="35"
value="#url.activateKey#">
and activate = 0
</cfquery>

briz26

unread,
Jul 11, 2007, 11:59:20 AM7/11/07
to
thanks c wigginton.... thats great help!
0 new messages