Chirag
|
Posted: 09/30/2003, 4:26 AM |
|
In my web apps(ASP), I'm trying to incorporate windows integrated security
|
|
|
Norbert
|
Posted: 10/01/2003, 7:44 AM |
|
Hi,
Try using the following code (I use Code Charge Studio) :
Function Page_AfterInitialize() 'Page_AfterInitialize @1-1E3DE16C
'Custom Code @186-73254650
' -------------------------
Dim NameSQL, DomainLogonName, WelcomeName
DomainLogonName = UCase(Request.ServerVariables("LOGON_USER"))
WelcomeName=CCDLookup("[Emp_FullNameWelcome]","[V_Emp]","[Emp_LoginName]='" & DomainLogonName & "';", DBPR)
EmpName.Value = WelcomeName
If EmpName.Value = Empty then response.redirect "PR_Unrecognized.asp"
The key is the LOGON_USER "variable" passed via HTTP headers.
Remember that you must disable anonymous access to the particular folder in IIS in order to have the script working. If you didn't do that then LOGON_USER would be empty.
Just in case you do not use Code Charge Studio: CCDLookup is just something like the line below:
"select [Emp_FullNameWelcome] from [V_Emp] where [Emp_LoginName]= " & DomainLogonName
Norbert
|
|
|
|