> How reliable would this scenario be, then:
>
> One application with one application.cfm. Three locations for the
> application: local development machine, public production server,
> private production server. Only some resources are available on
> each platform, need a way to determine which platform app is
> running on to disable attempting to access unavailable resources.
>
> For example:
> Production machine - all resources available - NT authentication,
> access to resources off the box.
> Private machine - NT authentication available, no access to
> resources off the box.
> Local machine - W98, PWS - no NT authentication available
>
> How to identify which location the app is running on within the
> same application.cfm and conditionally process accordingly?
>
> Currently using check on CGI.HTTP_HOST for either
> localhost/127.0.0.1 or www.publicserver.com or IP address of
> private server. Is this unreliable for this? Is there a better way?
> This appears to be working but this thread has made me wonder.
For the most part, it'll work the way you're doing it. My point was about
the degree to which you could guarantee that info being correct. Any
information provided by the browser can be tampered with. For example, if
your app is looking at HTTP_HOST or SERVER_NAME to see whether the user can
access an administrative interface, I can write a script which says it's
looking for "localhost" or whatever your app is using. If that's not a
concern to you, then don't worry about it.
As an alternative, what I generally recommend for machine-specific
application settings is that you store them on the machine itself, and have
your application read those values from wherever you've stored them. You
could store them in a text file, or within the registry, for example. If you
store them in a file, make sure that file doesn't get overwritten when you
move a new build of your application from development to production.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists