hotcat
|
| Posted: 06/14/2002, 7:48 AM |
|
Hello all at YES, and members of forum :))
I know nothing about ASP / scripts etc.
Use CC and now want to use CCS - have ver.106 Trial.
I have created a Search with Members Grid (on same page).
Click on User ID takes user to Member Details (any one chosen).
However, members should be able to UPDATE their own (and ONLY THEIR OWN)
Record. What 'script' can you suggest, on what page and where should it be placed ?? Your help will be greatly appreciated. THANKS. hotcat
|
|
|
 |
Sean
|
| Posted: 06/14/2002, 8:36 PM |
|
Hope I understand what you need. You need to add code to the Before Update event for the record form. Compare the UserID from the record to the Session("UserID") parameter. This is assuming that you have had the user login to the application. Not sure how you are displaying the UserID on the form so I can't specifically answer how to compare them. Then after that you need to set the UpdateAllowed variable to false.
For Instance, assume the UserID is visible in a label on the record form and the user has logged in to the system. In BeforeUpdate you would add:
If Label_name.Value <> Session("UserID") Then
UpdateAllowed = False
End If
I know there are other ways to do this but this could be one of them. Hope this helps.
|
|
|
 |
Nomad
|
| Posted: 06/15/2002, 6:29 AM |
|
Hotcat,
I have just completed a Staff Directory Portal page for my local Intranet whereby I was faced with a similar situation as yourself. Our users log-on to their NT 4 Workstations and then bring up the Portal page. What I needed to do was grab both the IP Address and their log-in name from their workstation.
I did this by creating an "On Initialize View" event on my Portal page. Because we use several NT Domains within our organisation I had to determine the correct one the user was using, hence the extra code shown below. But you should be able to adapt it anyways.
' -------------------------
' Write your own code here.
' -------------------------
' Force Authentication if the LOGON_USER Server Variable is blank
' by sending the Response.Status of 401 Access Denied
' Finish the page by issuing a Response.End so that a user
' cannot cancel through the dialog box
If Request.ServerVariables("REMOTE_USER") = "" Then
Response.Status = "401 Access Denied"
Response.End
End If
' Grap User machine IP Address for Session Variable
Session("IPAddress") = Request.ServerVariables("REMOTE_ADDR")
Session("Migrated") = ucase(mid(Request.ServerVariables("REMOTE_USER"),4,1))
If Session("Migrated") = "D" Then
Session("RacfID") = ucase(mid(Request.ServerVariables("REMOTE_USER"),11,8))
End If
If Session("Migrated") = "M" Then
Session("RacfID") = ucase(mid(Request.ServerVariables("REMOTE_USER"),9,8))
End If
If Session("Migrated") = "R" Then
Session("RacfID") = ucase(mid(Request.ServerVariables("REMOTE_USER"),6,8))
End If
If Session("Migrated") = "-" Then
Session("RacfID") = ucase(mid(Request.ServerVariables("REMOTE_USER"),10,8))
End If
'End Custom Code
I then created an "A Link" control to pass the Session Variable to URL in order then to display the users correct record in order for them to update it if they so required.
Hope it helps you.
|
|
|
 |
|