Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using windows password 1

Status
Not open for further replies.

Terminus

IS-IT--Management
Jul 16, 2003
31
0
0
GB
Hi there i have an administrators section to my website and i need to password protect it.

What i would like to do is use the administrator password on my windows network to log into the admin page. I can prompt for a windows password using the iis but that would allow any user on teh windows network to log on to it.

Can any1 help me?

Terminus
 
Terminus,

Try this:
Code:
strAuthUser = Request.ServerVariables("AUTH_USER")

If strAuthUser = "Administrator" then
  - your code -
Else
  Response.Write("Sorry you do not have the correct access privledges.")
End if

If your network is a domain then you will need to break the AUTH_USER variable into two parts and lose the domain name before checking the user name.

Try this:
Code:
strAuthUser = Request.ServerVariables("AUTH_USER")
strAuthUser = Mid(strAuthUser, InStr(strAuthUser, "\")+1)

(Do bare in mind that checking against the Administrator user name will allow the local Administrator user to access your page as well as the domain Administrator from the server.)

Hope this helps,


Barry

ICT Network Administrator
IT Services Manager
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top