D
Drew
I am trying to limit access to certain pages on our intranet, and have been
using the following code to do so,
dim Login, L, LL, StringLen, NTUser
Set Login = Request.ServerVariables("LOGON_USER")
L=Len(Login)
LL=InStr(Login, "\")
StringLen=L-LL
NTUser = (Right(Login, StringLen))
If NTUser <> "DLaing" Then
If NTUser <> "DLowe" Then
If NTUser <> "DWoods" Then
Response.Redirect("http://swvtc06/swvtc/default.asp")
End If
End If
End If
The problem is that if I want to add more users to have access to the page,
then I have to add another IF and END IF line. I would like to implement
some way to do this using an array. For instance put the usernames into the
array and then if it matches then allow access, if not then redirect. I
know this is not a bulletproof way to do this, and there are more robust
methods, but this works very well for our user base and our needs. I am
having a really bad case of brain block, and cannot, for the life of me,
figure this out.
Thanks,
Drew
using the following code to do so,
dim Login, L, LL, StringLen, NTUser
Set Login = Request.ServerVariables("LOGON_USER")
L=Len(Login)
LL=InStr(Login, "\")
StringLen=L-LL
NTUser = (Right(Login, StringLen))
If NTUser <> "DLaing" Then
If NTUser <> "DLowe" Then
If NTUser <> "DWoods" Then
Response.Redirect("http://swvtc06/swvtc/default.asp")
End If
End If
End If
The problem is that if I want to add more users to have access to the page,
then I have to add another IF and END IF line. I would like to implement
some way to do this using an array. For instance put the usernames into the
array and then if it matches then allow access, if not then redirect. I
know this is not a bulletproof way to do this, and there are more robust
methods, but this works very well for our user base and our needs. I am
having a really bad case of brain block, and cannot, for the life of me,
figure this out.
Thanks,
Drew