Howdy all -
Summary:
A top level Application.cfc sets up the application vars and handles login with
CFLOGIN.
A child folder Application.cfc (extends parent) does not seem to have access to
the GetAuthUser() set in the parent Application.cfc
The index.cfm file in this child folder however does correctly report
GetAuthUser().
----------------------------------------------------------------------------------------
So I'm constantly getting tripped up with the Application.cfc file and what it
will and won't do, and more importantly
what 'I think' it should be doing.
Here's the scenario. I've got an application running in a sub-folder of an
intranet. The intranet will pick up the Active Directory user ID from AUTH_USER
that the browser picks up. The intranet then will user this username to
automatically log them in. It works great and I've done this many time on all
kinds of things. Except in this one case something is screwy...
I guess the best way to describe it is through a simple diagram with numeric
keys explaining the parts.
Note:
Session data is being passed, so that's not the issue.
Intranet Folders and Files:
CFLHDIntranet (folder) (1)
\--- Application.cfc (2)
\--- DocShare (folder) (3)
\--- Application.cfc (4)
\--- index.cfm (5)
1) - The whole intranet lives in this folder.
2) - Application.cfc (abreviated)
<cfcomponent output="true">
<cfset this.name="CFLHDIntranet"> <cfset
this.sessionmanagement="yes"> <cfset
this.SetClientCookies="no"> <cfset
this.loginstorage="session"> <cffunction
name="onSessionStart" returntype="void">
I do a bunch of login stuff to log them in and set an
EMP_ID from the DB
<cflogin> <cfloginuser
name="#loginQuery.EMP_ID#" Password="#loginQuery.password#"
roles="#loginQuery.ROLE#"> </cflogin>
</cffunction>
3) - Folder that the quarrelsome application lives in
4) - Application.cfc - This file will not return the GetAuthUser() as it was
set in the parent Application.cfc
<cfcomponent extends="CFLHDIntraNet.Application">
<cfoutput>#GetAuthUser()# |#this.name#|</cfoutput> - test before cflogin
is called: returns domain/username <cflogin
applicationtoken="#this.name#"></cflogin>
<cfoutput>#GetAuthUser()#</cfoutput> - test after cflogin is called: returns
domain/username
--- a bunch of application level security needing the EMP_ID code from
the parent Application.cfc ----
</cfcomponent>
5) However, if you call index.cfm the GetAuthUser() returns '707'=EMP_ID as it
should.
Thanks for your time!
BN
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]