SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : The Server :

Previous DiscussionNext Discussion
 How to keep records private

I have set up a system for users to log on and amend their profiles. For various reason the best way to call their record up is like so www.anyoldsite.com/profile.asp?username=user123 It works of course the recordset looks for the username field within the URL and passes the browser through to his/her page. Great. They amend, upload, save and all shows online and is searchable. Great! However......

... any enterprising user with time on his/her hands could soon discover that user123 in the address bar could be substituted for (say) user124 and hey presto - because he/she is already authenticated via user123 he/she has access to user124 too. The authentication script is as follows

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="signin.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

How can I alter that to restrict user to their record only?

Started By Jockrock on Oct 9, 2009 at 5:17:52 AM

2 Response(s) | Reply

Earlier Replies | Replies 2 to 2 of 2 | Later Replies
ChrisRickard on Oct 9, 2009 at 9:26:02 AM (# 2)

Still on asp classic??? :D

So it looks like you're storing the username in the session variable MM_Username. Check to see if the username QueryString is the same as the session variable. In fact it kind of makes it unnecessary to even specify the qeurystring because you can just pick it up from the session. That is unless you want to include some kind of supervisor/admin ability to see others' profiles. In that case you need to make sure the logged in user has authorization to do so.


Earlier Replies | Replies 2 to 2 of 2 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.