This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!---Get the key---> | |
<cfset authKeyLocation=expandpath('../auth/key.txt')> | |
<cffile action="read" file="#authKeyLocation#" variable="authkey"> | |
<!--- New password hashing ---> | |
<!--- Generate a salt, this is never stored in it's plain form---> | |
<cfset theSalt=createUUID() /> | |
<!--- Hash the password with the salt in it's plain form---> | |
<cfset passwordHash=Hash(thePassword & theSalt, 'SHA-512') /> | |
<!--- The encrypted salt to store in the database, using the authKey---> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset salt=createUUID() /> | |
<cfset passwordHash=Hash(thePassword & salt, 'SHA-512') /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset thePassword='myPassword1'> | |
<cfset passwordHash=Hash(thePassword, 'SHA-512') /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************* | |
FORMS | |
Notes: Add this predefined values to your /config/settings.cfm file: | |
Then, just make sure you add #startFormTag(class="generic")# to any form you want this CSS applied to. | |
<cfscript> | |
// Form Field Defaults | |
set(functionName="textField,textFieldTag,textArea,textAreaTag,passwordField,passwordFieldTag,select,selectTag,fileField,fileFieldTag", | |
prependToLabel="<div class='field'>", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<h2>Photos</h2> | |
<!--XML last cached #application.FlickrXmlstarted#---> | |
<cfloop from="1" to="#ArrayLen(photosets)#" index="i"> | |
<cfoutput> | |
<div id="photoset" class="clear"> | |
<!---Output primary image---> | |
<img class="left" src="http://farm#photosets[i].XmlAttributes['farm']#.static.flickr.com/#photosets[i].XmlAttributes['server']#/#photosets[i].XmlAttributes['primary']#_#photosets[i].XmlAttributes['secret']#_s.jpg"> | |
<!---output title---> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfsilent> | |
<!---Flickr Params---> | |
<cfparam name="flickr" default="http://www.flickr.com/services/rest/" /> | |
<cfparam name="key" default="Your API Key Here" /> | |
<cfparam name="userid" default="Your User ID Here"> | |
<!---url.reinit used to manually refresh--> | |
<cfparam name="url.reinit" default=""> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset n1 =0> | |
<cfset n2 =1> | |
<table> | |
<thead> | |
<tr><th>Row</th><th>No.</th><th>Length</th> | |
</thead> | |
<tbody> | |
<cfloop from="1" to="1000" index="i"> | |
<cfset x = (n1 + n2)> | |
<cfoutput> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="update"> | |
<cfloop from=1 to="#arraylen(contact.emailaddresses)#" index="i"> | |
<cfset contact.emailaddresses[i].delete()> | |
</cfloop> | |
<cfset contact.update(params.contact)> | |
<cfif contact.hasErrors()> | |
<cfset renderPage(action="edit")> | |
<cfelse> | |
<cfset flashInsert(success="The contact was updated successfully.")> | |
<cfset redirectTo(action="view", key=contact.id)> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<cfif params.action EQ "add"> | |
<h2>Add a New Contact</h2> | |
#startFormTag(class="generic", id="contact-edit", action="create")# | |
<cfelse> | |
<h2>Editing Contact</h2> | |
#startFormTag(class="generic", id="contact-edit", action="update", key=params.key)# | |
</cfif> | |
#errorMessagesFor("contact")# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Dynamic Email Field Template---> | |
<div id="email-templates" class=" clearfix" style="display: none ;"> | |
<div id="::FIELD1::" class="emailtemplate clearfix"> | |
<div class="span-11"> | |
<div class="field"> | |
<label for="contact-emailaddresses-::FIELD2::-email">Email Address</label> | |
<input type="text" value="" size="62" name="contact[emailaddresses][::FIELD12::][email]" maxlength="500" id="contact-emailaddresses-::FIELD3::-email" class="email"> | |
</div> | |
</div> | |
<div class="span-3"> |