473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

authenticateUser

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
Jul 22 '05 #1
1 1438
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" <a@a.a> wrote in message
news:42*********************@mistral.news.newnet.c 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

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael B. Murdock | last post by:
I have been attempting to find a script that works in a variety of AD implementations to authenticate a user from a form in ASP. After many failed attempts I developed the following test script...
0
by: soundchaser | last post by:
I'm looking for a simple but complete example of creating a VB.Net ActiveX / COM component from a C Library. One should be able to use it by calling the Server.CreateObject method from an ASP...
1
by: djmc | last post by:
Hi, In my web application, I catch SoapExceptions and check the SoapException.Message property to determine the error that occurred. For instance, when authenticating a user, if the...
1
by: Steve | last post by:
I have a bit of "login authentication" code that in the event of a server error, connection error, etc will take a Looooooong time to timeout. I wanted to redesign it to call the DAL method in a...
1
by: Arpan | last post by:
I have created a simple ASP.NET calculator in a ASPX page (which exists in C:\Inetpub\wwwroot\ASPX folder). Before allowing a user to access this calculator, I want to first find out whether the...
2
by: Ken Crismon | last post by:
Hello, I am currently working on an embedded systems project where by I have written a small web server that is being hosted on our internet appliance (running on an Atmega128 chip and doing...
3
by: Nitinkcv | last post by:
Hi, While trying to run my app im getting the error Could not find a part of the path "c:\inetpub\wwwroot\Do not Delete\dbglobal.config". I checked and found that there is no Important_Do not...
5
by: wak0 | last post by:
Hi, I hope you guys can help me. I need to build a form that request username and password on ASP not ASP.net (sorry to clarify but i got some responses in other forums in .net) This form will...
3
by: Genius79 | last post by:
Hi I'm trying to do an ASP authentication using Ldap and would like to have the users directed to pages based on the Organizational Unit. My ASP knowledge is pretty basic but would really like to get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.