I haven't tried this with Application.cfc but this does work in
Application.cfm so I assume it would work. Just use one app file and put
some code like this in it:

<cfset thisPath = ExpandPath("*.*")>
<cfset thisDirectory = GetDirectoryFromPath(thisPath)>
<cfset folderName = listlast(thisDirectory,"\")>
<cfif folderName is "secure">

Do login routine

</cfif>

I just tried it and seems to do what you describe.

-Dusty 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clarke Bishop
Sent: 05/23/2008 6:53 PM
To: discussion@acfug.org
Subject: [ACFUG Discuss] Multiple Application.CFC files

In my webroot, I am trying to setup a secure directory where a login is
required. I got some good ideas the other day from Doug, but I'm still
having trouble.

Here's what I'm trying to do

/webroot/
   accessibleStuff.cfm
   /secure/
      stuffThatRequiresLogin.cfm

So, anything in the secure directory requires a login.

Now, I've got an Application.cfc in my webroot. All, I have to do, is put
another Application.cfc in the secure directory and check for login.

Problem 1.

CF only processes one Application.cfc. So, when I add the second
Application.cfc, all my session initialization, error handling, etc. in
webroot.Application doesn't run. 

I think the answer to this is to make the second Application.cfc extend
webroot.Application, but maybe there's a better way.

Problem 2.

When I did have the second Application.cfc extend webroot.Application, cfm
pages in the secure directory don't fire the OnSessionStart event located in
webroot.Application.

My plan was to test the value of SESSION.IsLoggedIn, but it's failing
because IsLoggedIn did not get initialized by OnSessionStart.

What am I missing? Is there a better way to do this?

Thanks,

    Clarke





-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists Archive @
http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------






-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to