If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Is there an easier way?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-04, 16:37
rrnml rrnml is offline
Registered User
 
Join Date: Sep 2004
Posts: 5
Is there an easier way?

I am trying to restrict access to certain asp pages on my intranet. This is how it is currently written. I grab the user and if it does not match any of the groups specified, access is denied. Here is the code. Is there an easier way to do this? Thanks for any help or suggestions.

<%
'Temporary Fix to allow only Agents to Use Employee Search form.

Dim strParm3
strParm3 = Request.ServerVariables("Remote_User")
strParm4 = Mid(strParm3,8,15)
Response.write strParm3
If (strParm4 <> "RETAILERINTRA") and (strParm4 <> "retailerintra") and (strParm4 <> "SECURITYTOP") and (strParm4 <> "securitytop") and (strParm4 <> "SECAGENTS") and (strParm4 <> "secagents") then

Response.write strParm3
Response.write strParm4
Response.write "You do not have access to this page. Please notify Security for access"

Else
%>
Reply With Quote
  #2 (permalink)  
Old 09-30-04, 22:05
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
First option would be to replace your if with a case statement...

Second option would be to build a indexed collection of some sort

but if you want to do it in code that is a fairly simply way to do things...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On