Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > authenticateUser

Reply
Thread Tools

authenticateUser

 
 
Andy
Guest
Posts: n/a
 
      06-22-2005
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


 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      06-22-2005
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

"Andy" <(E-Mail Removed)> wrote in message
news:42b962ce$0$150$(E-Mail Removed) o.uk...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments