CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Making sure the user only edit/updates own record...

Print topic Send  topic

Author Message
Rey
Posted: 01/06/2005, 1:59 PM

How do I make sure that my application only allow user edit/update/delete their own record? How do I make use of the login info (userID and password) to "tag" the user?

Rey
peterr


Posts: 5971
Posted: 01/06/2005, 2:05 PM

Please refer to our main tutorial, which describes just that:
http://docs.codecharge.com/studio/html/QuickStart/Creat...rInitEvent.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Rey
Posted: 01/07/2005, 2:41 PM

Hi Peter:
I still could not make it work. This is what I want to do:

I have "Paul" as the login name. On an Access database, there is a field called names with an entry item called Paul.

My intention is to compare the login name and make sure that if Paul is logged in, he can only edit/delete the record with the Paul entry on it. How do I go about it?

I tried the following (after initialize) but it would not work:

If CCGetUserID() = asred1.names.Value Then

asred1.UpdateAllowed = True
asred1.UpdateAllowed = True
asred1.DeleteAllowed = True
Else
asred1.UpdateAllowed = False
asred1.UpdateAllowed = False
asred1.DeleteAllowed = False
End if

Thanks for any help.
Rey





Oper


Posts: 1195
Posted: 01/09/2005, 7:22 PM

values still not loaded while "after initialize" event.

you will need to get the value in advanced somthing like

useridinrecord = ccdlookup("useidinrecord","table","myrecord=" & request.querystring("myrecord"),dbconnection1)

then:
if ccgetuserid() = useridrecord then
.
.
..
.
.





_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
Rey
Posted: 01/10/2005, 7:11 AM

Thank Oper for the reply....

But poor me! 'pardon me if I'm still confused. Here's what I have:

Connection1
asred.mdb (Table1)
ID
State ====> test entry is "Texas"


Connection2
asredsecurity.mdb (Table2)
ID
User
Password
Group

Test value:
ID=3
User="Texas"
Password="itsme"
Group="Texas"


When I log in as "Texas" using connection2, I like the program to check the database using connection1 for the state="Texas". If asredsecurity.user.Value=asred.state.value, then it would allow me to update/edit/add/delete otherwise I could just view the record.

Thanks for any code that you could provide me.

Rey

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.