Actually the way to protect custom tags and include files from being called
directly by the browser is to move them outside the web root.  CFMODULE and
CFINCLUDE both find files using the server's file system, NOT the web server
software.

Therefore if you have a web root here:
        c:\inetpub\wwwroot\mysite

then put your tags here:
        c:\inetpub\wwwroot\customTags

put your include files here:
        c:\inetpub\wwwroot\includeFiles

This way a tag cannot be called directly by the browser.

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecomunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: Jim McAtee [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 30, 2001 4:06 PM
To: CF-Talk
Subject: Restricting execution of CF tag


If I've got CF tag with, let's say, a file name of "header.cfm", is there a
way within the tag to test if it's been called as a CF tag?  I'd like to
keep the template from being executed if it's ever designated in a url and
to simply <cfabort> if it wasn't used as a tag.

Similarly, I usually name cfinclude'd files with a .cfm extension.  Is there
a means of testing to see if the current template has been cfincluded within
another?  Once again, just to keep the included file from being executed
stand-alone.

Thanks,
Jim

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to