Yeah, you bet. While I don't do it all the time, it's definitely a viable tool to have in your set. Just watch out because it doesn't work if the code you're executing is encrypted, for obvious reasons.
<cffile action="read" file="..." variable="fc" /> <cfset fc = replace(fc, "<cf_securitycheck>", "<cf_securitycheck id="#myId#">") /> <cffile action="write" file="..." output="#fc#" /> I'd check out whatever version control system you're using to see if it assigns unique resource IDs of some sort, and then use that as your ID using keyword substitution (your nomenclature may vary). Since you can move resources around inside the VC system, you'd avoid the issues with that at the raw filesystem level. And since it's happening once for the file, not once per execution, you'll also alleviate issues with running the file on your dev server and having to unset the IDs befor eyou deploy live and stuff. cheers, barneyb On 8/3/05, Mike Soultanian <[EMAIL PROTECTED]> wrote: > I am trying to create a file security system and I have a custom tag > that checks the security settings on a CFM file every time it is > accessed. So, at the top of the page would be: > > <CF_SECURITYCHECK> > > This tag checks the database to see if the logged-in user has access to > the file and continues loading the page if the user does. If the user > doesn't have access, the user will be sent to an error page. Obviously, > to keep track of every file on the system the database needs to have a > unique identifier for each file. I could use the directory/filename, > but if move a file, that would cause problems because the database would > "lose" the information on that file and permissions would have to be > reset (pain). > > So, what I want to happen is when a CFM page is accessed for the first > time, I want it to edit itself and put in a a unique file identifier > that it will then be stored in the database. So, for example, it will > take the following: > > <CF_SECURITYCHECK> > > and change it to: > > <CF_SECURITYCHECK FileID="[some randomly generated unique number]"> > > I know this may not be possible, but I thought I'd check anyways. > Otherwise, does anyone know how I can identify a file by some unique > characteristic (i.e. checksum maybe)? It's kinda similar to an NTFS > system where the system knows the permissions on a file regardless of > where it moves to. > > What I would like to avoid is generating my own unique numbers in each > file. I could do it that way, but I'd like to find a clean and more > automatic way to take care of it. > > Thanks, > Mike > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:213657 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

