ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 8th, 2000, 03:59 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
collect NT domain/username

<i><b>Originally posted by : maciek (slavpapr@athenet.net)</b></i><br /><br />Request.ServerVariables("Logon_User") is supposed to provide a means of collecting the logonname of a user logged on to an NT intranet. However, this method does not appear to work across a proxy server. Is there some other method of collecting the domain/username without resorting to a login dialog?

Reply With Quote
  #2  
Old April 8th, 2000, 12:24 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Peter G. (agr747@yahoo.com)</b></i><br />You say this does not work thru a proxy server but my problem is the LOGON_USER does not even work at all (in an intranet website). Here is the whole page:<br /><br /><%@ Language=VBScript %><br /><HTML><br /><HEAD><br /><title>ADSI Get user details</title><br /></HEAD><br /><BODY><br /><%<br /> sFullUser = trim(Request.ServerVariables ("LOGON_USER"))<br /> iPos = InStr(sFullUser, """)<br /> sDomain = Left(sFullUser, iPos - 1)<br /> sUser = Mid(sFullUser, iPos + 1)<br /> <br /> Set objUser = GetObject("WinNT://" & sDomain & "/" & sUser)<br />%><br /><br /><p><br />Your account is <%=sFullUser%> and your name is <%=objUser.FullName%><br /></p><br /><%<br /> set objUser = nothing<br />%><br /></BODY><br /></HTML><br /><br />The output comes down to a VBScript error and says 'Left' is an invalid invocation or argument. Once again, please note that I ran this on a local intranet with ASP 2, IIS 4, and NT Server 4 as "Administrator".

Reply With Quote
  #3  
Old April 9th, 2000, 05:22 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : maciek (slavpapr@athenet.net)</b></i><br />I would include a check to see if Logon_User is empty. You will definitely get an error with the Left function if there is no whack (/). Also, have you tried displaying the server variables:<br /><%<br />For Each objItem In Request.ServerVariables<br /> Response.Write objItem & " = " & Request.ServerVariables(objItem) & "<BR>"<br />Next<br />%><br /><br />Assuming you use NTFS and merely want to check for user permission for a NT user on an intranet, you can use the MS permission checker:<br /><br /><% dim UserHasAccess<br />Set pmck = Server.CreateObject "MSWC.PermissionChecker")<br />UserHasAccess = pmck.HasAccess("./yourfile.asp")<br />If UserHasAccess Then %><br /><br /><br /><br /><br />------------<br />Peter G. at 4/8/2000 10:24:13 AM<br /><br />You say this does not work thru a proxy server but my problem is the LOGON_USER does not even work at all (in an intranet website). Here is the whole page:<br /><br /><%@ Language=VBScript %><br /><HTML><br /><HEAD><br /><title>ADSI Get user details</title><br /></HEAD><br /><BODY><br /><%<br /> sFullUser = trim(Request.ServerVariables ("LOGON_USER"))<br /> iPos = InStr(sFullUser, """)<br /> sDomain = Left(sFullUser, iPos - 1)<br /> sUser = Mid(sFullUser, iPos + 1)<br /> <br /> Set objUser = GetObject("WinNT://" & sDomain & "/" & sUser)<br />%><br /><br /><p><br />Your account is <%=sFullUser%> and your name is <%=objUser.FullName%><br /></p><br /><%<br /> set objUser = nothing<br />%><br /></BODY><br /></HTML><br /><br />The output comes down to a VBScript error and says 'Left' is an invalid invocation or argument. Once again, please note that I ran this on a local intranet with ASP 2, IIS 4, and NT Server 4 as "Administrator".

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > collect NT domain/username


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT