Click to See Complete Forum and Search --> : 'Auth_User' without the domain/server


BarryMVS
06-13-2003, 11:30 AM
I'm setting up an intranet on a Windows 2000 Domain Controlled network.

I want to use the 'Auth_User' server variable as my session control. The variable is always returned as 'servername/username' or 'domainname/username'.

Can anyone think of a way of coping the variable and shortening it to just the username?

I'm sure there is a way of deleting characters in JavaScript, but I'm not sure how to do it.

Thanks in advance.

BarryMVS
06-16-2003, 04:19 AM
Dave,

Thanks for your script. I'm using VBScript for my ASP.

I copied and pasted your script into a blank ASP page, making sure I placed it in between <% %>.

Unfortunatlly it returned the full AUTH_USER next to the 'User='.

Thanks for trying,

BarryMVS
06-16-2003, 09:05 AM
I got it.

In my original script i put the slash in, but the wrong way around. I put '/' when infact it is a '\'. :o

I changed this in your script and it now works. Thanks for your help and sorry for the mistake. :)

Cheers,

cmelnick
06-17-2003, 11:09 AM
Don't mean to butt in on something Dave has already answered, but another option would be:


loginVars = Split(Request.ServerVariables("AUTH_USER"), "/")


Then you have both variables in one nice array. Domain in loginVars(0), and user in loginVars(1)...

But Dave is super smart, so you should probable just stick with listening to him :D