Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2006, 07:54 AM
Authorized User
 
Join Date: Mar 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is it possible to obtain the windows login?

I have a database with access and asp. We dont necesarily need a login for these pages, but there are a couple places where we would like to know who filled out a form automatically without them typing in their name and/or username.

Everyone has a unique windows username.
Is there a way for asp to see the users windows username?

Thanks

 
Old April 6th, 2006, 06:59 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Yes. use server variables - Request.ServerVariables("LOGON_USER")

A full list:
http://www.w3schools.com/asp/coll_servervariables.asp



Wind is your friend
Matt
 
Old April 6th, 2006, 10:51 PM
Authorized User
 
Join Date: Mar 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried that. It returns nothing.

 
Old April 7th, 2006, 11:26 AM
Authorized User
 
Join Date: Mar 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Upon reading about the login user variable, that only applies if anonymous access is turned off, and users have to login to see the page. I DO have anonymous turned on, and I do not want to force users to login. I just want to be able to see their WINDOWS login. I dont even know if its possible or not, I cant find much when searching for it.

 
Old April 9th, 2006, 07:15 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I have just reliaed we use a .ocx file for this, sorry...

Wind is your friend
Matt
 
Old April 9th, 2006, 10:06 PM
Authorized User
 
Join Date: Mar 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is an ocx?

 
Old April 9th, 2006, 10:49 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

An active X Control, usging JS - Some back ground:

1. Place this OCX (30kb) and the HTML file on the server. Codebase defines the path to the ocx so if they are not in the same directory then change accordingly
2. The OCX does NOT have to be registered on the server using regsvr32
3. Success in running OCXs (ActiveX objects) from within a browser will depend on the Browser security settings.

Then run the following page:

<HTML>
<HEAD>
<OBJECT Name="FindUser"
      classid="clsid:xxxxxxxxxxxxx-00FC-484C-ACE0-xxxxxxxxxxxxxxxx"
      codebase="xxxxxxxxxxxxxxxxxxxxx.ocx#version=1,0,0, 0"
>
</OBJECT>
</HEAD>
<BODY>
<H1> ActiveX Test Page </H1><p>
<p>
  <span id="user">Logged on user: </span>
</p>
<form>
  <input type="hidden" id="formVar">
</form>
<SCRIPT language="JavaScript">
  document.all.user.innerHTML = 'Logged on user: ' + FindUser.UserLogon();
  document.all.formVar.value = FindUser.UserLogon();
</script>
</BODY>
</HTML>

Works like a charm however is our propriety software.

Sorry that doesnt help you however it gives you an idea of how I do it

Wind is your friend
Matt
 
Old April 24th, 2006, 10:19 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Matt, your solution is exactly what I am looking for. Please excuse my lack of knowledge in this area. Is the code you posted all that is needed to obtain the logged in User Id? Or is there a separate OCX file that is needed to make this work? Thank you....

 
Old April 24th, 2006, 10:01 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;Or is there a separate OCX file that is needed to make this work?

Yes there is. As I said above this is propriety software, it would not be ethical of me to give it away.

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent help - Customized Windows login Rehanrana C++ Programming 0 December 26th, 2007 08:15 AM
Windows Service auto login theBadKid C# 2005 1 November 30th, 2007 05:04 AM
Getting a Handle on Windows Login with AD dparsons C# 0 February 28th, 2007 09:30 PM
windows login detection atrash C++ Programming 1 July 28th, 2006 05:10 AM
Using windows login credentials aldwinenriquez ASP.NET 2.0 Professional 0 June 18th, 2006 08:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.