Here's an easy one for you.   Top part is the tag call and the bottom
part is the tag itself.  Makes up a password and strips out commonly
goofed letters ('S' vs '5' etc.).  18 lines of code.  Variable pwd
length.  Have at it.

<cfmodule 
        template="tag_pwdmaker.cfm"
        myPwdLen="8">
<html><head><title></title></head><body>
<cfoutput>#variables.myPwd#</cfoutput>
</body></html>

<!----- 
-----------------------------
now for the tag itself 
-----------------------------
--->

<cfparam name="caller.myPwd" default="" type="string">
<cfparam name="attributes.myPwdLen" default="8" type="numeric">
<cfloop 
        condition="Compare(Len(caller.myPwd),attributes.myPwdLen)">
        <cfset variables.RandCharRange=RandRange(0,2)>
        <cfswitch expression="#variables.RandCharRange#">
                <cfcase value="0">
                        <cfset caller.myPwd=caller.myPwd & 
chr(RandRange(48,57))>
                </cfcase>
                <cfcase value="1">
                        <cfset caller.myPwd=caller.myPwd & 
chr(RandRange(65,90))>
                </cfcase>
                <cfcase value="2">
                        <cfset caller.myPwd=caller.myPwd & 
chr(RandRange(97,122))>
                </cfcase>
        </cfswitch>
        <cfset 
caller.myPwd=ReReplace(caller.myPwd,"(0|o|O|1|i|I|l|5|S)","","all")>
</cfloop>



-- 
--mattRobertson--
Janitor, MSB Web Systems
mysecretbase.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212916
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to