I have been building an intranet security layer for all internal
provided reports / applications at my company. Once of the things I
wanted to do was have a method for an admin to 'validate' the state of a
given report (ie the numbers are all correct, output is correct, etc).
I decided to hash the folder listing contents, and I thought this might
be useful for someone else out there, so here ya go =)
<!---// Get a directory listing of our report folder, so we can get some
date information as well as a dir hash //--->
<cfset folderPath = listDeleteAt(cgi.PATH_TRANSLATED,
listLen(cgi.PATH_TRANSLATED, '\'), '\') />
<cfdirectory directory="#folderPath#" action="list" name="dirListing">
<!---// QoQ to get the most recent update of this list //--->
<cfquery name="getRecent" dbtype="query" maxrows="1">
SELECT DATELASTMODIFIED
FROM dirListing
ORDER BY dateLastModified DESC
</cfquery>
<!---// Create a savecontent var of all filenames and their size and
last modified date, then hash it to make a unique file fingerprint
//--->
<cfsavecontent variable="dirData">
<cfoutput query="dirListing">
#Name#-#datelastmodified#-#size#
</cfoutput>
</cfsavecontent>
<cfset directoryHash = hash(dirData) />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274639
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4