This code is in the application.cfm of the Family app. I grabbed it for
my own app and it works fine as long as you don't try to add any other
files to the directAccessFiles list variable. That is, if you don't
have any direct access files other than request.self. I had to add a
file for my CF administrator and this code wouldn't let me access the
file.
<cfset request.self="index.cfm">
<!--- add any files that can be directly accessed to this list --->
<cfset directAccessFiles="#request.self#,">
<cfloop list="#directAccessFiles#" index="file">
<cfif not listFindNoCase(cgi.script_name, file, '/')>
<!--- Run this code, including sending to request.self, or
logging potential hack attempts --->
</cfif>
</cfloop>
I replaced it with this:
<cfset self="index.cfm">
<!--- Put the template names in this list --->
<cfset directAccessFiles="
#self#,directaccessfile1.cfm,directaccessfile2.cfm,">
<cfset AllowAccess=false>
<cfloop list="#directAccessFiles#" index="file">
<cfif listFindNoCase(cgi.script_name, file, '/')>
<cfset AllowAccess=true>
</cfif>
</cfloop>
<cfif not allowaccess>
<!--- Run this code, including sending to request.self, or logging
potential hack attempts --->
</cfif>
==^================================================================
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]
T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================