Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - how to capture network USERID
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to capture network USERID

 Post Reply Post Reply
Author
jeffrey.sweeney View Drop Down
Newbie
Newbie


Joined: 08 September 2003
Location: Algeria
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffrey.sweeney Quote  Post ReplyReply Direct Link To This Post Topic: how to capture network USERID
    Posted: 08 September 2003 at 2:22pm
I've got an off the shelf application which is accessing an SQL database and retireving all sorts of corporate info etc. When you first launch the page the user is asked to put in initials and a password. This information is stored inside the SQL database and determines what the user can see & do to the other data. I would like to modify how this works so that when a user launches the page their network userID is used to determine their rights to the data. They are never prompted for a userID etc. I've got the database side of things all setup but I need to get the UserID. Ultimately the plan is to seemlessly incorporate this into part of our intranet.

Any help would be greatly appreciated. I apologize if my nomenclature is off but this all foreign to me.

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2003 at 3:17pm
You get the Windows Username with Request.ServerVariables("Logon_User") or ("Auth_User") thus you would have to disable Anonymous access for this dir to use it successfully.
Back to Top
jeffrey.sweeney View Drop Down
Newbie
Newbie


Joined: 08 September 2003
Location: Algeria
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffrey.sweeney Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2003 at 9:01am
This is a great start but it gives me the information in the following format:

domain\userId

Is there a way to isolate just the userID portion?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2003 at 9:02am
Replace(Request.ServerVariables("Logon_User"),"domain\","")
Back to Top
jeffrey.sweeney View Drop Down
Newbie
Newbie


Joined: 08 September 2003
Location: Algeria
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffrey.sweeney Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2003 at 9:43am
This is what I put in:


var sUserID = Replace(Request.ServerVariables("Logon_User"),"AHCD\","");

Where AHCD is the domain name.

I receive the following error:

Error Type:
Microsoft JScript compilation (0x800A03F7)
Unterminated string constant
/authenticate/login.asp, line 35, column 74

I've also tried it this way (as well as a half doxen other variants):

var sUserID2 = String(Request.ServerVariables("Logon_User"));
var sUserID = String.Replace(sUserID2,"AHCD\","");

With the same error.

I appreciate your help!


Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2003 at 1:28pm
Kill the ; this is not a sql script it is vbs
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2003 at 12:26pm
Hes using Jscript...
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2003 at 12:40pm
Ay, did not even notice that. Use server side vbscript...
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.