navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

USERNAME

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> USERNAME
Page: [1]
 
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
USERNAME - 7/29/2005 17:22:32   
Hi Everyone:

I need to insert the Active Directory username into a web page. Can anyone tell me how to do that ? The page(s) are .asp but the username doesn't have to be in the form section on those pages. The webserver is 2003 but everything else (AD) is on a 2000 server.

Thanks,

Mike
jaybee

 

Posts: 14191
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: USERNAME - 7/30/2005 19:08:13   
I'm not an asper but is this the sort of thing you're trying to do?

quote:

For starters, we'll be using VBScript as our server-side processing language. This is declared at the top of the page. Next, we'll build a simple Web form containing three main elements: (1) a textbox to hold the username, (2) a password box to hold the value of the password, and (3) a submission button to process the form. Note how we use the value of <input type="password"> for the password box to ensure that anything entered into it isn't readable, being displayed as a series of stars. Next, we include some server-side processing…and this is where the real fun begins. Within the Value attribute of the textbox for the Username, we include the statement <%= Request("USERNAME") %>. This will be used to automatically insert the Username value the user enters if the page fails authentication, to save time.


Link here

or

this

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to mtee55)
dpf

 

Posts: 7126
Joined: 11/12/2003
From: India-napolis
Status: offline

 
RE: USERNAME - 7/30/2005 20:07:37   
quote:

insert the Active Directory username
assuming they are signed into your network with their Active Directory username, does that in anyway relate to how they access the net? am I even correct in that you are talking about wind NT's Active Directory directory services? like Novell's NDS ( network Directory Services)?

_____________________________

Dan

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/1/2005 14:27:47   
No. They want to pull in the login/username from AD automatically. So that the user logged in is automatically identified when they access the form page. No actual login or password for them to do. I know that when you submit a form to Access Db that the user_name is one of the automatic fields that you can have in your database so it must be getting that from AD. Just can't figure out how to have it populate a field or text area in the actual page or form field. They want to identify the user filling out the form automatically.

Thanks,

Mike

quote:

ORIGINAL: jaybee

I'm not an asper but is this the sort of thing you're trying to do?

quote:

For starters, we'll be using VBScript as our server-side processing language. This is declared at the top of the page. Next, we'll build a simple Web form containing three main elements: (1) a textbox to hold the username, (2) a password box to hold the value of the password, and (3) a submission button to process the form. Note how we use the value of <input type="password"> for the password box to ensure that anything entered into it isn't readable, being displayed as a series of stars. Next, we include some server-side processing…and this is where the real fun begins. Within the Value attribute of the textbox for the Username, we include the statement <%= Request("USERNAME") %>. This will be used to automatically insert the Username value the user enters if the page fails authentication, to save time.


Link here

or

this


(in reply to jaybee)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/1/2005 14:28:51   
Yup. I am referring to pulling the username from active dir.

thanks,

mike

(in reply to dpf)
sentinel

 

Posts: 568
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: USERNAME - 8/1/2005 15:11:03   
Hey there...

I had to do something similar on my network. What i ended up doing was turning off anonymous web browsing and giving rights only to authenticated users on the network.

You can then do something like this

<%=request.servervariables(" LOGON_USER" )%> to show user name

if you want to strip off the domain do this

Right(Request.Servervariables("Logon_User"),8)

8 being the amount of characters your domain name is.

Hope that helped

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/1/2005 18:01:03   
hmmmm.... let me tinker with this.... thanks.

Mike

(in reply to sentinel)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: USERNAME - 8/2/2005 16:21:41   
quote:

hmmmm.... let me tinker with this.... thanks.


Remember that you need to turn on Integrated Authentication and turn off Anonymous Access for that to work most times. This is the code I normally use:

<%
MyVar=request.servervariables("logon_user")
MyVar=MyVar & ""
MyPos = InstrRev(MyVar, "/", -1, 1)
UserName=Mid(MyVar,MyPos+1,Len(MyVar))
'   	Response.write(UserName & "<br>")
IF trim(UserName) & "" = "" THEN
   	Response.write("Error in Validate User routine")
ELSE
   	'Do page Stuff
END IF%>


_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to mtee55)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: USERNAME - 8/2/2005 16:23:14   
quote:

What i ended up doing was turning off anonymous web browsing and giving rights only to authenticated users on the network.


Didn't see that before I posted but that is frequently the problem that a lot of users have with that script.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to sentinel)
sentinel

 

Posts: 568
Joined: 5/4/2005
From: Chicago, Illinois
Status: offline

 
RE: USERNAME - 8/2/2005 17:13:33   
Heres a question I had presented to me today.

Can this be done in a NOvel environment on an Apache server running php?

(in reply to rdouglass)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/2/2005 17:48:34   
That worked pretty good. i get domain\username....

I had to use AUTH_USER though vs. LOGON_USER.

Stripping the domain didn't work....

per:
+++++++++

if you want to strip off the domain do this

Right(Request.Servervariables("Logon_User"),8)
+++++++++

Mike

(in reply to sentinel)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: USERNAME - 8/3/2005 11:28:02   
quote:

Stripping the domain didn't work....


Did you try this one?

...
MyVar=request.servervariables("logon_user")
MyVar=MyVar & ""
MyPos = InstrRev(MyVar, "/", -1, 1)
UserName=Mid(MyVar,MyPos+1,Len(MyVar))
...

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/3/2005 11:34:19   
I just did but it did not work....

What is the whole syntax ?

Thanks,

Mike
(I really am a newbie when it comes to this...........)

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: USERNAME - 8/3/2005 11:37:08   
quote:

What is the whole syntax ?


It depends on how you're grabbing the variable. Can you post what you're currently using?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to mtee55)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/3/2005 11:49:18   
This is the basic way I am grabbing it. Now that I have it working in a form field, I am not sure if anything but a one liner will work.

Thanks


<%=request.servervariables("INSERT VARIABLE" )%>

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: USERNAME - 8/3/2005 11:50:34   
quote:

<%=request.servervariables("INSERT VARIABLE" )%>


Are you using logon_user ?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to mtee55)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: USERNAME - 8/3/2005 11:55:48   
I think I may have had the slash wrong for that script. Does this one work better?

<%
DIM myUserName
MyVar=request.servervariables("logon_user")
MyVar=MyVar & ""
MyPos = InstrRev(MyVar, "\", -1, 1)
myUserName=Mid(MyVar,MyPos+1,Len(MyVar))
Response.write(myUserName & "<br>")
%>

If so, put that at the top of your page, comment out the Response.write line, and use this in your form field:

value="<%=myUserName%>"

That any better?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rdouglass)
mtee55

 

Posts: 55
Joined: 7/14/2005
Status: offline

 
RE: USERNAME - 8/3/2005 12:12:14   
Works GREAT ! Thanks so much for the help. Also to SENTINAL for starting me in the right direction.

Best,

Mike

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> General Web Development >> USERNAME
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts