Use ASP to Determine & Display User Login Name?

C

Chris DeVries

According to the FP 2002 help section:

"Give every visitor to your site a personalized view of
just the information she seeks. On an intranet, for
example, you can use ASP to determine the login name of
the user. When she visits an employee information page,
her name and personal data will be displayed by default,
eliminating the need for another login screen."

This is just what I want to do, as I'm building an
intranet site around an MS environment and want to make an
ASP that will veryify username for login and display
username and email address on the subsequent screen. How
is this accomplished? I've found a lot of references with
rough code examples, but no specific directions on what
code to put where, how to implement the proper items, etc.
I'm even using Jim Buyens' FP 2002 Inside Out book. :)

Any help is very much appreciated.

Thanks!
Chris
 
J

Jim Buyens

-----Original Message-----
According to the FP 2002 help section:

"Give every visitor to your site a personalized view of
just the information she seeks. On an intranet, for
example, you can use ASP to determine the login name of
the user. When she visits an employee information page,
her name and personal data will be displayed by default,
eliminating the need for another login screen."

This is just what I want to do, as I'm building an
intranet site around an MS environment and want to make
an ASP that will veryify username for login and display
username and email address on the subsequent screen. How
is this accomplished? I've found a lot of references with
rough code examples, but no specific directions on what
code to put where, how to implement the proper items,
etc. I'm even using Jim Buyens' FP 2002 Inside Out
book. :)

On an intranet, you don't generally need to write code tht
validates user accounts. Just remove anonymous access from
your Web site, and grant access to one or more Windows
groups (i.e. Domain Users).

If the visitors log into the domain and are use IE, IE
will log them in to your site automatically. Otherwise,
they'll be prompted for their domain, username, and
password.

Once the page is running, you can get the current username
from any of these expressions. I generally use the first
one.

request.servervariables("AUTH_USER")
request.servervariables("LOGON_USER")
request.servervariables("REMOTE_USER")

Depending on the browser and other factors, the username
thus retrieved may include a domain name, and the
separator character may be / or \. To get the username
only, try:

authUser = _
Replace(Request.ServerVariables("AUTH_USER"),"/","\")
aUser = Split(authUser,"\")

select case ubound(aUser)
case 1
curUsr = aUser(1)
case 0
curUsr = aUser(0)
case else
curUsr = ""
end select

Jim Buyens
Microsoft FrontPage MVP
[email protected]
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Top