|
wizard_oz -> RE: Active Directory Authentication (6/15/2009 10:01:29)
|
Hi, thanks it's working on my computer but now the problem is when I install my code at the server so anyone will be able to login it is not working. if I load just simple HTML file it is working. this is my code <FORM action="UserDB.asp" method=get id=form1 name=form1>
<%
'will return Domain\Username or just Username depending
'if the user is logged into the domain or their local machine.
logon = Request.ServerVariables("LOGON_USER")
UserName1=Request.ServerVariables("PATH_INFO")
'so we split the logon variable by the "\"
myArray = Split(logon, "\", -1, 1)
Set objADSysInfo = CreateObject("ADSystemInfo")
strUser = objADSysInfo.username
Set objUser = GetObject("LDAP://" & strUser)
UserSingleNameCounter=len(objUser.name)-3
UserSingleName=right(objUser.name,UserSingleNameCounter)
Response.Write "<br><br>Hello " & right(objUser.name,UserSingleNameCounter)
'take the upper bound of the logon variable objUser.name
logon = myArray(Ubound(myarray))
'and you're left with just the NT Username
NTUserName = lcase(logon)
'Response.Write "<br><br><br><br>" & NTUserName
Response.Write "<INPUT type=hidden id=UserSingleName name=UserSingleName value=" & NTUserName & ">"
Response.Write "<INPUT type=hidden id=NTUserName name=NTUserName value=" & NTUserName & ">"
%><br><br><br><br>
<INPUT type="submit" value="äîùê" id=submit1 name=submit1>
</FORM>
can anyone please help me.... Thanks, Elen
|
|
|
|