Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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, 17: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, 23:05
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
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

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