Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
CFDevGuy #1
Dynamic Password Generation
I am looking for ideas of the best way to create a dynamic password when a user
registers with an online service. You know the sort of thing...tt would be
stored in DB, and sent to the email address provided by the user. When the user
returns and authenticates with their username and dynamic password they were
sent, they can change the password to their liking.
This is the first time I have been tasked with this sort of thing, so any
advice and/or tips are very much appreciated. Thanks.
CFDevGuy Guest
-
Dynamic KFP Generation
We have the need for dynamic (real-time) generatation of a KFP file (Acrobat Preflight Profile) based on metadata managed in a SQL database for use... -
Dynamic Select Generation
I created a dynamic select tag using information I pulled from an Access database. What I want to know is how you set the first item in the drop... -
Dynamic PDF generation
we have CFMX 2004 on Linux I would like to know what it takes or what all I need to Retrieve the data from database and generate PDF ( Setting... -
dynamic Flash generation
Does anyone know of a framework for dynamic Flash content generation? A sort of web app framework that dynamically generates Flash SWFs based on... -
Dynamic Screen Generation
It is possible using mx2004 Pro to create screens dynamically? I have a bunch of custom components and want to use xml to basically create those... -
jorgepino #2
Re: Dynamic Password Generation
you could use this and change it as needed
[url]http://www.macromedia.com/cfusion/exchange/index.cfm#loc=en_us&view=sn106&viewNa[/url]
me=Exchange%20Search%20Details&authorid=33575664&p age=0&scrollPos=0&subcatid=0&s
nid=sn106&itemnumber=17&extid=1001895&catid=0
jorgepino Guest
-
CFDevGuy #3
Re: Dynamic Password Generation
Thanks Jorge, I will try it out. I don't know how I missed that :-)
CFDevGuy Guest
-
BKBK #4
Re: Dynamic Password Generation
Two files, one cfc and one cfm.
Calling page, saved, for example, as pwgen.cfm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Alphanumeric password generation</title>
</head>
<body>
<!--- Call the CFC for password generation, passwordgen.cfc --->
<cfinvoke component="password_gen" method="generatePassword"
returnvariable="password">
<cfinvokeargument name="passwordLength" value="6">
</cfinvoke>
<cfoutput>password: #password#</cfoutput>
</body>
</html>
<!---
Component for alphanumeric password generation.
Only one required input, the password length.
Author: BKBK, July 13, 2005
Save it, for example, as file password_gen.cfc
--->
<cfcomponent displayname="passwordGenerator" hint="Contains method for
generating password of given length">
<cffunction name="generatePassword" output="No" returntype="string">
<cfargument name="passwordLength" type="numeric" required="Yes">
<cfset password = "">
<cfloop condition="0 EQ 0">
<!--- Random integer between 49 and 122 --->
<cfset i = #randRange(49,122)#>
<cfset condition = NOT (i GT 57 AND i LT 65) and NOT (i GT 90 AND i LT 97)
and (NOT (i EQ 79) AND NOT (i EQ 111))>
<cfif (Len(password) LT #arguments.passwordLength#) and condition>
<!---
Construct random alphanumeric password of length #passwordLength#,
using digits, capital letters and small letters. Exceptions are zero(0)
capital letter O amd small letter o, which often confuse the user.
--->
<cfset password = password&chr(i)>
</cfif>
<cfif Len(password) EQ #arguments.passwordLength#>
<cfbreak>
</cfif>
</cfloop>
<cfreturn password>
</cffunction>
</cfcomponent>
BKBK Guest



Reply With Quote

