close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

I want to secure update page or filter records so that only the owner of the record can update it

Thread began 4/29/2020 10:00 pm by jo271221 | Last modified 4/30/2020 2:38 pm by Ray Borduin | 30 views | 4 replies |

jo271221

I want to secure update page or filter records so that only the owner of the record can update it

Is there a security rule that can be added to match the record owner (in this case customerid in products table = id in users table)
Or do I need to create a recordset that will show no record available if the criteria is not met.

I attempted the recordset but I obviously do not know how to code that correctly.

Please see PM.

Sign in to reply to this post

Ray BorduinWebAssist

No security rule, but I think you can use the server behavior: WebAssist->Utilities->Show Region Utility to do it.

Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

I added the WA show if but am missing something.
All logged in users are seeing the #2 section

<?php if ($WADAhorses_update->TotalRows == 0) { // Show if mysqli recordset empty ?>
1.<br>
You must have admin rights to this horse in order to edit profile. If you are the admin of this horse</p> <a href="login.php" class="button">LOG IN</a>
<?php } // Show if mysqli recordset empty ?>
<?php if ($WADAhorses_update->TotalRows != 0) { // Show if mysqli recordset empty ?>
2.<br>
You are the owner - you may edit
<?php } // Show if mysqli recordset empty ?>


Do i add something like this inline ($WADAhorses_update->getColumnVal("customerid") != $_SESSION['SecurityAssist_id'])

Or modify my existing recordset
("SELECT horseid, customerid, handlercustid, horse_name, horse_height, horse_weight, horse_barn_name, br_incentive, horse_profile_pic, horse_pic2, horse_pic3, horse_pic4, horse_pic5, horse_moneyearned, pic_papers, horse_comments, horse_breed_id, horse_broodmare_yn, horse_reg_number, horse_discipline, horse_dob, horse_year_foaled, horse_month_foaled, horse_gender, horse_in_foal_yn, horse_color, horse_at_stud_yn, sire, siressire, siressiresire, siresiresdam, siresdam, siresdamssire, siresdamdam, dam, damssire, damssiresire, damssiredam, damdam, damdamssire, damsdamdam, admin_notes, admin_notes_royalcrown, horse_owner_name, horse_owner_address, horse_owner_city, horse_owner_state, horse_owner_zip, auction_lot_number, auction_status FROM horses WHERE horses.horseid = ?");

Attached Files
login.php
Sign in to reply to this post

Ray BorduinWebAssist

The IF statement should be something like:

if ($WADAhorses_update->getColumnVal("customerid") == $_SESSION['SecurityAssist_id']) {

Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

This worked perfectly. Thank you!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...