authenticateUser

A

Andy

Hi,

Does anybody know how to use the function authenticateUser in asp?

When I load my asp page, it should pass the logged on user to a variable
called 'vCreator' which should then be shown within a textbox on the screen.

My code for this section is as follows, but for some reason the field
appears blank???
***************
We run on AD 2003 in mixed mode

authenticateUser Request.ServerVariables("LOGON_USER")

Sub authenticateUser(nt_user)
Dim slashpos, spacepos, nt_user1, nt_userfirst, nt_userlast
slashpos = instr(nt_user,"\")
if slashpos <> 0 then
nt_user1 = mid(nt_user, slashpos + 1, len(nt_user)-(slashpos))
spacepos = instr(nt_user1," ")
end if
if spacepos <> 0 then
nt_userlast = Right(nt_user1, len(nt_user1) - (spacepos))

nt_userfirst = mid(nt_user, 4, spacepos)
end if
vCreator = nt_user1
vFrom = nt_userfirst & "." & nt_userlast & "@eastbourne.gov.uk"
End Sub
*************

Thanks

Andy
 
R

Ray Costanzo [MVP]

Hi Andy,

1. Make sure you have anonymous access turned off in IIS.
2. You're calling a sub that assigns a value to a variable (global scope?)
Are you writing that variable anywhere? Have you considered writing this as
a function?


Function Email(nt_user)
If nt_user <> "" Then Email = Split(nt_user & "\", "\")(1) &
"@eastbourne.gov.uk"
End Function

Do you really have usernames with spaces in them?

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top